Fixed code block output port alignment issue#5119
Fixed code block output port alignment issue#5119benglin wants to merge 10 commits intoDynamoDS:masterfrom
Conversation
There was a problem hiding this comment.
This code was simply updated to honor PortModel.LineIndex if it is specified, or PortModel.Index otherwise. No more differentiation between in/out ports.
|
@benglin don't have any other comments other than the questions above. The |
|
Hi @aparajit-pratap, the right description would look something like this in English: It is a panel that hosts all the list items, which is why it can dictate the accurate item positions. Thanks again for helping with the review! |
|
Closing this as it is replaced by #5123. |
|
@benglin Is this merged for RC branch?
|
|
@benglin - Ive tested this on 0.8.3 - please cross merge this on 0.8.2 RC branch. |
|
Thanks @marcellosgamb, I am able to reproduce the issue on latest build with fix. Thanks, |
|
Seems to be fixed at my end on latest 0.8.3 (both initial bug and the one reported by marcello) - @marcellosgamb - please retest when the build is posted. Tx |
|
Originally I thought it was a DPI related issue, but this works just fine on a Mac Bootcamp. @marcellosgamb, if you can try out on the latest build that'll be very helpful. Thanks! |


Purpose
This pull request is meant to fix a problem where output ports of a code block node do not completely lined up with their corresponding statements. The defect is being tracked internally as:
This problem is introduced by slight offset accumulated along the way as output ports are placed in their container
ItemsControl. This accumulative error is unavoidable as onedoublevalue counts on another previousdoublevalue.To address this problem, instead of having the default
StackPanel(inside anItemsControl) arranging each output port, we now make use of a newPanelderived class:InOutPortPanel. This panel is aware of eachPortViewModel(and indirectly,PortModelandPortData) object it contains so it is capable of arranging the ports accurately.In order not to lose any precision, the vertical offset values are no longer computed in an accumulative way:
Instead, a new property
PortModel.LineIndex(replacingPortModel.VerticalMarginproperty) is introduced for lossless offset computation. The value ofPortModel.LineIndexis assigned whenCodeBlockNodeModelgenerates its output ports (i.e. when it has the knowledge of statement indices too). Error on a port does not get carried over for calculating offset of the next port:This is how it looks after the fix:

### DeclarationsCheck these if you believe they are true
*.resxfilesReviewers
Hi @aparajit-pratap, since you were previously dealing with this, please take a look. Thanks!
FYIs
@riteshchandawar, it's done!