| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #2943
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | Incorrect drawing of rounded box |
Version: | 1.3-current |
Created By: | Nikego |
Assigned To: | AlbrechtS |
Fix Version: | 1.3.4 (SVN: v11815) |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | Nikego 04:26 Apr 03, 2013 |
| If size of widget is quite small then FLTK draws incorrect rounded box, all four corners are different (upper fig. on the attached picture). I investigated the issue and found out a few things: to fix it first we need to do mathematically correct rounding of coordinates. In other words, instead fl_vertex(x,y) must be fl_vertex(x+0.5,y+0.5) (second fig.). In fact, I suppose the rounding of coordinates is wider problem in FLTK.
Second, rbox will draw tidy corners only if size of their radius is even number (third fig.).
And the latest, I rarely used rounded box because of ugly appearance (IMHO). On the contrary, often I needed straight box but without sharp corners. Setting the RS (max radius) to small value (2..6) gives me what I want.(fourth fig.) Maybe, something like RS should be part of widget properties or at least it would be mentioned in docs as customising point? | |
|
#2 | AlbrechtS 02:57 Aug 14, 2014 |
| Nikita, could you please add the test program you created the images with in your recent post, so that we have a test case for different platforms. That would be very helpful. Thanks | |
|
#3 | Nikego 04:09 Aug 14, 2014 |
| OK, as a matter of fact it's only one fl file. It's enough to open it in Fluid to see result of changes. | |
|
#4 | AlbrechtS 15:23 Jul 15, 2016 |
| Fixed in Subversion repository.
Thanks for the patch and the demo (.fl) file.
I used your patch and simplified the code (removed superfluous variables).
I also modified your .fl file for testing (see rounded-box.fl).
Regarding RS (max radius): I documented some of the variables in the code, but I don't see a way to make the corner radius user-settable in FLTK 1.3. If you're still interested in such modifications, please file another STR for 1.4-feature. TIA.
Note: FLTK 1.4 will get some scheme modifications, and I'm confident that we can add such an option to the new Fl_Scheme system.
This STR is considered fixed now and will be closed in a few days. | |
[ Return to Bugs & Features ]
|
| |