Shape.Box is placed strangely
See original GitHub issueWhen you create a Box
, it is rendered with its center on the top left of the original dimensions used to create it.
relevantly:
lazy val position: Point = dimensions.position - (Point(square) / 2) - (stroke.width / 2)
I’m wondering if a box shape is really needed, or if box-specific constructors for a Polygon
would suffice.
Shape.Polygon(myRectangle.corners, ..., ...)
works identically in place of the broken
Shape.Box(myRectangle, ..., ...)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Packing Irregular Shaped Items: UPS - Reunion
Use these guidelines and tips to help you pack your irregularly shaped items correctly. This document contains: Bundled and Strapped Boxes ...
Read more >Weird SQUARE BOXES in updated fields - Oracle Communities
I updates few hundreds of records by multiple updte statements where i copied and inserted values. I think I left some blank spaces...
Read more >How can I adjust these weirdly large margins on my text box?
Not only a waste of space but weird looking. I adjusted all margins to 0 under text and shape using Format Shape -...
Read more >How to Package Odd-Shaped/Sized Objects for Shipping?
Take another, similar box and place it below or next to the first box ... On the other hand, packaging weird-shaped objects is...
Read more >Strange rectangle shape appears in the middle of cardView if I ...
This happens because of elevation . Set cardElevation to 0dp and check <androidx.cardview.widget.CardView android:layout_width="160dp" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed, will be in the next release.
Thanks for the thoughtful response!
Graphic
s behave and b) that you can change the reference pointParticularly, with the current API I’m not sure how the ref and the position relate. I would expect that the position would be the top left of the dimensions adjusted by the ref (ie. dimensions.topLeft + size/2 to get a centered position). Circle would be a bit less surprising to have the origin in the center (or maybe I’d expect the origin to be top left with a ref defaulted to the center). But then it’s very surprising that a
Polygon
behaves differently than aBox
, which I would assume is just a performance optimizedPolygon
with four sides at 90* angles.