Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix Vertical Margin of Note in Group #13068

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/DynamoCore/Graph/Annotations/AnnotationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class AnnotationModel : ModelBase
private const double MinTextHeight = 20.0;
private const double ExtendSize = 10.0;
private const double ExtendYHeight = 5.0;
private const double NoteYAdjustment = 8.0;

#region Properties

Expand Down Expand Up @@ -475,15 +476,15 @@ internal void UpdateBoundaryFromSelection()
var regionX = groupModels.Min(x => x.X) - ExtendSize;
//Increase the Y value by 10. This provides the extra space between
// a model and textbox. Otherwise there will be some overlap
var regionY = groupModels.Min(y => y.Y) -
var regionY = groupModels.Min(y => (y as NoteModel) == null ? (y.Y) : (y.Y - NoteYAdjustment)) -
ExtendSize - (TextBlockHeight == 0.0 ? MinTextHeight : TextBlockHeight);

//calculates the distance between the nodes
var xDistance = groupModels.Max(x => (x.X + x.Width)) - regionX;
var yDistance = groupModels.Max(x => (x.Y + x.Height)) - regionY;

var yDistance = groupModels.Max(y => (y as NoteModel) == null ? (y.Y + y.Height) : (y.Y + y.Height - NoteYAdjustment)) - regionY;
// InitialTop is to store the Y value without the Textblock height
this.InitialTop = groupModels.Min(y => y.Y);
this.InitialTop = groupModels.Min(y => (y as NoteModel) == null ? (y.Y) : (y.Y - NoteYAdjustment));


var region = new Rect2D
Expand Down Expand Up @@ -515,7 +516,7 @@ internal void UpdateBoundaryFromSelection()
else
{
this.Width = 0;
this.height = 0;
this.Height = 0;
}
}

Expand Down