Bläddra i källkod

avoid div by 0

Johann ELSASS 5 år sedan
förälder
incheckning
e72c675440
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      lazpaint/dialog/uchoosecolorinterface.pas

+ 3 - 1
lazpaint/dialog/uchoosecolorinterface.pas

@@ -205,7 +205,9 @@ var
   bmpCursorWidth, i: integer;
   bmpCursorWidth, i: integer;
   bmpCursorOpacity: byte;
   bmpCursorOpacity: byte;
 begin
 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.FontHeight := round(FTitleFontHeight * FBitmapScale);
   Bitmap.FontAntialias := True;
   Bitmap.FontAntialias := True;
   textBoundRight := Bitmap.Width / FBitmapScale;
   textBoundRight := Bitmap.Width / FBitmapScale;