浏览代码

optimize for qt5

Johann ELSASS 4 年之前
父节点
当前提交
b80b76715d
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lazpaint/uimageview.pas

+ 4 - 3
lazpaint/uimageview.pas

@@ -2,8 +2,9 @@
 unit UImageView;
 unit UImageView;
 
 
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
-{$IFDEF LINUX}{$DEFINE IMAGEVIEW_DIRECTUPDATE}{$ENDIF}
+{$IF defined(LINUX) and not defined(LCLqt5)}{$DEFINE IMAGEVIEW_DIRECTUPDATE}{$ENDIF}
 {$DEFINE DRAW_TOOL_OUTSIDE_IMAGE}
 {$DEFINE DRAW_TOOL_OUTSIDE_IMAGE}
+{$IF not defined(DARWIN) and not defined(LCLqt5)}{$DEFINE IMAGEVIEW_QUICKUPDATE}{$ENDIF}
 
 
 interface
 interface
 
 
@@ -942,7 +943,7 @@ begin
   {$ELSE}
   {$ELSE}
   FQueryPaintVirtualScreen := True;
   FQueryPaintVirtualScreen := True;
   FPaintBox.InvalidateRect(area);
   FPaintBox.InvalidateRect(area);
-  {$IFNDEF DARWIN}FPaintBox.Update;{$ENDIF}
+  {$IFDEF IMAGEVIEW_QUICKUPDATE}FPaintBox.Update;{$ENDIF}
   FQueryPaintVirtualScreen := False;
   FQueryPaintVirtualScreen := False;
   {$ENDIF}
   {$ENDIF}
 end;
 end;
@@ -1025,7 +1026,7 @@ begin
   if IntersectRect(updateArea, updateArea, AWorkArea) then
   if IntersectRect(updateArea, updateArea, AWorkArea) then
   begin
   begin
     FPaintBox.InvalidateRect(updateArea);
     FPaintBox.InvalidateRect(updateArea);
-    {$IFNDEF DARWIN}FPaintBox.Update;{$ENDIF}
+    {$IFDEF IMAGEVIEW_QUICKUPDATE}FPaintBox.Update;{$ENDIF}
   end;
   end;
   {$ENDIF}
   {$ENDIF}
 end;
 end;