Opened 5 weeks ago
Last modified 5 weeks ago
#19330 new enhancement
missing symmetry in View API to draw Region outline like StrokeRegion() for FillRegion()
Reported by: | grexe | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Kits/Interface Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
I would like to draw only the outline of a BRegion
.
The View API only provides FillRegion()
but for other forms like Rects or even Polygons it provides variants to only draw the outline via matching Stroke()
calls, not so for Regions.
Since there is no way to convert between polygons and regions, this is quite cumbersome and requires manually building a polygon from a point array taken from the region, or draw individual rectangular outlines via StrokeRect()
, which is not quite the same if the region is divided e.g. between lines in a TextView
.
Change History (4)
comment:1 by , 5 weeks ago
Description: | modified (diff) |
---|
comment:3 by , 5 weeks ago
I don't know if it makes much sense to provide this. BRegions may have a very odd arrangement of rectangles, they're more useful as an implementation detail than as a drawing method, I think?
comment:4 by , 5 weeks ago
maybe it's just my use case but in a TextView, e.g. selections are provided as a BRegion and contain contiguous BRects. If you want to do your own highlighting, you might want to just draw the outline.
It would be interesting to see where and how BRegions are used in the API and whether it makes sense to provide the missing function, or if this is really just a special case in my use case.
Nevertheless it wouldn't hurt to provide this as a convenience, feel free to use the (trivial) sample code above as a basis.
I implemented this like so: