I renamed variables (more consistent names), fixed code formatting, and
refactored the code around the resizing of widgets. I put common code
before and after the conditional '#if 1' that separated old code from
new "much simpler code from Francois Ostiguy" as a comment in the existing
code mentioned. Then I deactivated the old code and activated the new
"much simpler" code. Tested, works well.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12813 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
These scaling factors can be activated by defining the preprocessor
macro TEST_SCALING.
Note: this feature may be changed or removed in the future.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12812 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The docs of class Fl_Image and of Fl_Image::scale() are beefed up.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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