FLTK logo

[master] a4866ff - Partial fix for issue #188.

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] a4866ff - Partial fix for issue #188. "ManoloFLTK" Mar 15, 2021  
 
commit a4866ffc213f27618ffcf9718f1a18007bf779a3
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon Mar 15 15:11:56 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon Mar 15 15:12:25 2021 +0100

    Partial fix for issue #188.
    
    This fixes the inconsistency created by the possibility to change img->w() and img->h()
    values. The fix is to use img->data_w() and img->data_h() that have constant values.

 src/Fl_Shared_Image.cxx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git src/Fl_Shared_Image.cxx src/Fl_Shared_Image.cxx
index 832d8a3..5e2399f 100644
--- src/Fl_Shared_Image.cxx
+++ src/Fl_Shared_Image.cxx
@@ -101,10 +101,10 @@ Fl_Shared_Image::compare(Fl_Shared_Image **i0,          // I - First image
   int i = strcmp((*i0)->name(), (*i1)->name());
 
   if (i) return i;
-  else if (((*i0)->w() == 0 && (*i1)->original_) ||
-           ((*i1)->w() == 0 && (*i0)->original_)) return 0;
-  else if ((*i0)->w() != (*i1)->w()) return (*i0)->w() - (*i1)->w();
-  else return (*i0)->h() - (*i1)->h();
+  else if (((*i0)->data_w() == 0 && (*i1)->original_) ||
+           ((*i1)->data_w() == 0 && (*i0)->original_)) return 0;
+  else if ((*i0)->data_w() != (*i1)->data_w()) return (*i0)->data_w() - (*i1)->data_w();
+  else return (*i0)->data_h() - (*i1)->data_h();
 }
 
 
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'.