diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-03-02 16:19:18 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-03-02 16:19:18 +0000 |
| commit | 76b240d79d0972a34225aba06323a1f45ca1156f (patch) | |
| tree | 5f5bd82b9d458cd3a69f38a27c60a1d8b23eda03 /src/drivers/GDI | |
| parent | 5a8f3f908b2caccd1addd8a2ffe5dd1f02a48ecc (diff) | |
Fix negative 'd' and 'ld' args in fl_draw_image() (X11 + Windows).
This commit fixes a regression in FLTK 1.3.x, where negative values
of 'd' (pixel delta) and 'ld' (line delta) didn't work anymore under
Unix/Linux (X11) and Windows.
With this commit the regression is fixed on all supported platforms.
Equivalent of branch-1.3, svn r11270.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11272 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index f750e1785..070c65568 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -106,6 +106,8 @@ static void monodither(uchar* to, const uchar* from, int w, int delta) { #endif // USE_COLORMAP +static int fl_abs(int v) { return v<0 ? -v : v; } + static void innards(const uchar *buf, int X, int Y, int W, int H, int delta, int linedelta, int depth, Fl_Draw_Image_Cb cb, void* userdata, HDC gc) @@ -120,7 +122,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, if (indexed || !fl_can_do_alpha_blending()) depth = (depth-1)|1; - if (!linedelta) linedelta = W*delta; + if (!linedelta) linedelta = W*fl_abs(delta); int x, y, w, h; fl_clip_box(X,Y,W,H,x,y,w,h); @@ -281,8 +283,6 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } } -static int fl_abs(int v) { return v<0 ? -v : v; } - void Fl_GDI_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){ if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) { d ^= FL_IMAGE_WITH_ALPHA; |
