mcgilman commented on a change in pull request #3383: NIFI-4230 - Use a better 
default location when pasting via keystokes …
URL: https://github.com/apache/nifi/pull/3383#discussion_r273216522
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
 ##########
 @@ -1753,9 +1795,11 @@
                 if (!nfCanvasUtils.isConnection(selected)) {
                     if (nfCommon.isUndefined(origin.x) || d.position.x < 
origin.x) {
                         origin.x = d.position.x;
+                        origin.dimensions = d.dimensions;
                     }
                     if (nfCommon.isUndefined(origin.y) || d.position.y < 
origin.y) {
                         origin.y = d.position.y;
+                        origin.dimensions = d.dimensions;
 
 Review comment:
   This function operates on a D3 selection which in this case could represent 
multiple components. Here we are getting the smallest x and y values regardless 
of which component it comes from. We are also grabbing the dimension of the 
component that registers the smallest x or y value.
   
   - The resulting behavior of the function is not as cohesive anymore. It 
seems to be serving a couple of purposes now.
   - I'm not sure this is the behavior we want when there are multiple 
components selected. Does the viewport check when pasting work correctly when 
there are 1 and more than 1 component selected? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to