FLTK logo

STR #2943

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

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:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 Nikego
04:26 Apr 03, 2013
rounded_box.tar.gz
22k
 
 
#2 Nikego
16:17 Jul 04, 2014
rounded_box.png
27k
 
 
#3 Nikego
16:18 Jul 04, 2014
rounded_box.patch
1k
 
 
#4 Nikego
04:07 Aug 14, 2014
test-rounded.fl
2k
 
 
#5 AlbrechtS
15:23 Jul 15, 2016
rounded-box.fl
2k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#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 ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.