Fix issue with Fl_Tiled_Image: did not correctly draw

... to sub-region of widget.

Original patch (PR #114) modified by Albrecht-S:
 - fixed whitespace
 - removed modifications of test/unittest_images.cxx
This commit is contained in:
fire-eggs
2020-07-20 15:22:00 -04:00
committed by Albrecht Schlosser
parent b65d3a249d
commit cdda89455c
+3 -3
View File
@@ -1,7 +1,7 @@
//
// Tiled image code for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2015 by Bill Spitzak and others.
// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -182,9 +182,9 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position
if (cx > 0) iw -= cx; // crop image
if (cy > 0) ih -= cy;
for (int yy = Y; yy < H; yy += ih) {
for (int yy = Y; yy < Y+H; yy += ih) {
if (fl_not_clipped(X,yy,W,ih)) {
for (int xx = X; xx < W; xx += iw) {
for (int xx = X; xx < X+W; xx += iw) {
if (fl_not_clipped(xx,yy,iw,ih)) {
image_->draw(xx,yy,iw,ih,cx,cy);
}