FLTK logo

[master] 4171cbe - Windows scaling: fix computation of border sizes.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 4171cbe - Windows scaling: fix computation of border sizes. "ManoloFLTK" Dec 01, 2020  
 
commit 4171cbe0befc3d9cc1367e0d715fb1dee622d376
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Dec 1 16:57:55 2020 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Dec 1 16:58:08 2020 +0100

    Windows scaling: fix computation of border sizes.
    
    The corrected error was to use, e.g.,
      int dx = W - w->w() * s;
    which does not produce the desired integer value.
    The correct writing is :
      int dx = W - int(w->w() * s);

 src/Fl_win32.cxx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git src/Fl_win32.cxx src/Fl_win32.cxx
index 4f96658..0a9f709 100644
--- src/Fl_win32.cxx
+++ src/Fl_win32.cxx
@@ -1741,12 +1741,12 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx,
         W = r.right - r.left;
         H = r.bottom - r.top;
         bx = drawingX - r.left;
-        by = r.bottom - (drawingY + w->h() * s); // height of the bottom frame
+        by = r.bottom - int(drawingY + w->h() * s); // height of the bottom frame
         bt = drawingY - r.top - by;          // height of top caption bar
         xoff = bx;
         yoff = by + bt;
-        dx = W - w->w() * s;
-        dy = H - w->h() * s;
+        dx = W - int(w->w() * s);
+        dy = H - int(w->h() * s);
         if (w_size_range_set && (w_maxw != w_minw || w_maxh != w_minh))
           ret = 2;
         else
@@ -1802,9 +1802,9 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx,
     Y = scr_y;
   // Make client area's lower right corner visible
   if (scr_x + scr_w < X + dx + w->w())
-    X = scr_x + scr_w - w->w() * s - dx;
+    X = scr_x + scr_w - int(w->w() * s) - dx;
   if (scr_y + scr_h < Y + dy + w->h())
-    Y = scr_y + scr_h - w->h() * s - dy;
+    Y = scr_y + scr_h - int(w->h() * s) - dy;
   // Make client area's upper left corner visible
   if (X + xoff < scr_x)
     X = scr_x - xoff;
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

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