-
Notifications
You must be signed in to change notification settings - Fork 569
Closed
Labels
enhancementadds or requests a new featureadds or requests a new feature
Description
The stroke method on our drawing context draws the stroke centered on the path; if the path it is passed is equal to the layout bounds, half of the stroke will be outside of those bounds.
This means that any widget that draws a stroke and does not account for this will end up drawing outside of its layout bounds.
This is illustrated well by the flex example program, from which I've taken the following zoomed screenshots:



The solution to this is fairly simple; we should inset our layout size before painting, increasing the layout size if necessary. When dealing with a Rect this is as easy as,
let layout_rect = Rect::ZERO.with_size(paint_ctx.size());
let paint_rect = layout_rect - Insets::uniform(my_stroke_width / 2.0);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementadds or requests a new featureadds or requests a new feature