-
Notifications
You must be signed in to change notification settings - Fork 453
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
Fix shape-specific grid container sizing #1294
Fix shape-specific grid container sizing #1294
Conversation
9f9b464
to
5a3fa6b
Compare
shapeType := d2target.DSL_SHAPE_TO_SHAPE_TYPE[dslShape] | ||
s := shape.NewShape(shapeType, geo.NewBox(geo.NewPoint(0, 0), contentWidth, contentHeight)) | ||
|
||
var fitWidth, fitHeight float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a method in shape
to avoid having to consider this everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because we don't place labels inside the person shape, if we were fitting the shape to the label size, it would use the func below
} else { | ||
fitWidth, fitHeight = s.GetDimensionsToFit(contentWidth, contentHeight, paddingX, paddingY) | ||
} | ||
obj.Width = math.Max(float64(desiredWidth), fitWidth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not obeying the set size. Only if it is smaller than the content.
From what I remember, we simply ignore the set size for containers. Maybe, it should be same here. It doesn't make much sense to be different from the current behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated tala to use desiredWidth as long as content fits
Summary
Use shape specific sizing for grid containers.
Details
before/after