STR #2798

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 ]

STR #2798

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:2 - Specific to an operating system
Subsystem:X11
Summary:X11 coordinate clipping - label
Version:1.3-current
Created By:dfleury2
Assigned To:AlbrechtS
Fix Version:1.4.0
Fix Commit:2411336e8443ebe483b8023b16f1f9a37b84374b
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size top right image
 
#1 dfleury2
13:47 Dec 22, 2011
patch.txt
1k
 
bottom left image   bottom right image

Trouble Report Comments:


Name/Time/Date Text top right image
 
#1 dfleury2
13:47 Dec 22, 2011
It seems that X11 use short value for drawing string (XDrawString),
for Fl_Tree_Item, it can make problem of drawing labels when x, y overflow short max/min values.

In this sample, there is 4 labels that must not appear (out of bound).
A naive patch attached to prevent simple cases to happen.
I keep fltk gurus for a better solution.


#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>

struct MyWindow : Fl_Window {
   MyWindow() : Fl_Window( 30,50,500,300, "Label bug" )
   {}
   
   void draw() {
      fl_draw( "01",     0, 30 );
      fl_draw( "0123",   0, 40+65536 );
      fl_draw( "012345", 0, 50-65536 );     
      fl_draw( "0123", -20, 60 );

      fl_rtl_draw( "01",     2,  50, 130 );
      fl_rtl_draw( "0123",   4,  50, 140+65536 );
      fl_rtl_draw( "012345", 6,  50, 150-65536 );     
      fl_rtl_draw( "0123",   4, -20, 160 );
   }
};

int main() {
   MyWindow w;
   w.show();
   return Fl::run();
}
 
 
#2 AlbrechtS
15:45 Jan 08, 2020
Fixed in Git repository.

Thanks for the report, the demo program, and the patch. And sorry for the long delay.

The fix is now in FLTK 1.4 (Git) and will be included in the next snapshot (on Friday, Jan 10, 2020).

The patch consists of two consecutive commits - part 2 was a missing patch for right-to-left text (fl_rtl_draw()).

Note that the code has changed much between 1.3 and 1.4, hence it won't be backported to 1.3, but the implementation is close to your patch.

Additional note: this doesn't mean that everything in FLTK under X11 is now clipped correctly. Box drawing code and all lines except horizontal and vertical lines may still have 16-bit issues.
 
 
#3 AlbrechtS
15:47 Jan 08, 2020
Note: this STR will be closed in a few days.  
 
#4 AlbrechtS
05:38 Jan 14, 2020
Closed.  
bottom left image   bottom right image

Return to Bugs & Features ]

 
 

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