Browse Source

avoid div by 0

Johann ELSASS 5 năm trước cách đây
mục cha
commit
e72c675440
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      lazpaint/dialog/uchoosecolorinterface.pas

+ 3 - 1
lazpaint/dialog/uchoosecolorinterface.pas

@@ -205,7 +205,9 @@ var
   bmpCursorWidth, i: integer;
   bmpCursorOpacity: byte;
 begin
-  FBitmapScale := Bitmap.Width / vsColorView.Width;
+  if vsColorView.Width <> 0 then
+    FBitmapScale := Bitmap.Width / vsColorView.Width
+    else FBitmapScale := 1;
   Bitmap.FontHeight := round(FTitleFontHeight * FBitmapScale);
   Bitmap.FontAntialias := True;
   textBoundRight := Bitmap.Width / FBitmapScale;