Some border lines were too short or too long, the shading code would draw
too many shaded lines, and the code was hard to understand.
With this commit all background pixels of the box are drawn exactly once.
The border lines are consistent, but some pixels of the border are not
drawn at all so the background shines through. This is intended for
backwards compatibility.
A minor change is that the drawn background does no longer overlap the
border lines. Hence undrawn pixels that previously displayed the colored
box background are now transparent and show the parent's background color.
This commit adds comments and implementation notes to make the code
easier to understand and better maintainable (hopefully).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12779 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Each image has now two sizes implemented as follows:
- the pixel size is stored in private members pixel_w_ and pixel_h_
with public accessors pixel_w() and pixel_h()
- the FLTK size is stored in private members w_ and h_ and read by w() and h()
- when the image is constructed, the two sizes have the same value
- the protected w(int) and h(int) member functions set both FLTK and pixel sizes.
- the public scale(int, int) member function is essentially nothing but
set the FLTK size and don't change the pixel size.
- when the image is drawn, its FLTK size determines how big it is drawn, its pixel
size determines how much data are available to draw it.
FLTK 1.3.4 with FL_ABI_VERSION=10304 contained an equivalent member function
but only for the Fl_Shared_Image class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12776 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
and other font stuff. Fixed horizontal and vertical line
drawing to include last pixel. Added stippling to focus rect.
Added point drawing (slooow).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12774 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Better complex region cleanup - should be compete now...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12772 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
However I did disable the complex region optimizer - too tired to get
the pointers right... .
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12770 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Next: intersetcing a complex clipping region with a rectangle
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12769 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
fallbacks, added emergency font as an asset, added graceful
behavior when absolutely no font could be loaded.
Next: add other font related calls, add clipping
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12767 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Next: add other font related calls, add clipping,
add font paths for package resources
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12766 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Next: add caching, add other font related calls, add clipping,
add font paths for package resources
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Next: cleanup, document, add caching, add other font related calls,
add clipping, add font paths for package resources
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12764 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This code is still a total mess and incredibly inefficient.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12763 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
files, further fostering follows.
Or, to put it bluntly, I forgot how the font system works, and now I am
digging through the implementations of other drivers, carrying bits and
pieces together. But you know that I will clean my files eventually... .
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12762 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
render better text, so I have something to test this on.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12761 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This is a preliminary patch to enable linking with pango on MacOS
when fltk-config is used. A better solution is under development.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12759 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This code is not very beautiful, but the resulting class should be
easy to use. A range-based loop can be used to find all relevant
clipping rectangles for a drawing call.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12754 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Make clipping methods non-virtual so they can be inlined.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12753 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
fl_rectf is so far the only function that uses the complex clipping
region successfully. Code is slow, but works.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12747 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Clipping areas are calculated for overlapping windows, named "Desktop
Windows". The first level implementation works if the resulting complex
region is just a rectangle. Higher complexity (sub-rectangles) is next.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12746 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Complex clipping is needed to allow popup dialogs and menu window while
still correctly rendering windows that are "below" those popups.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12745 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Back to 16-bit coordinate limit clipping (actually +/- (2**15 - 8).
The clipping range is now constant, symmetrical, and stored in the
driver object.
Also fixed a bug in Liang-Barsky line clipping algorithm.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12744 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
improved Fl_Rect_Region class instead of Fl_Rect. Commented out
complex clipping.
Android lib and apps now use C++11 because they can (and I like it).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12741 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Also, added rectangular clipping which works.
Expanding now to a more complex clipping scheme to make multiple
windows work.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12739 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Note: These two functions are not yet UTF-8 aware. Results may be unexpected.
Possible test case: run test/file_chooser or any FLTK program with
Fl_File_Chooser. The default display order is determined by fl_numericsort():
Fl_File_Chooser::sort = fl_numericsort;
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12738 ea41ed52-d2ee-0310-a9c1-e6b18d33e121