Browse Source

skia: fixed blur radius

mattias 1 year ago
parent
commit
c3c0e3d853

+ 1 - 3
demo/ButtonGenerator/MainUnit.pas

@@ -88,11 +88,9 @@ begin
   Stylesheet.Add('#ButtonDiv {'
     +'background:'+BackgroundColor1+';'
     +'border:1px solid '+BorderColor+';'
-    +'border-radius:16px;'
     +'padding:16px 31px;'
     +'font-size:15px; font-family:Arial; font-weight:bold;'
     +'color:#fff;'
-    +'text-shadow: 1px 1px 0px #2f6627;'
     +'}'
     +'.CheckBox {'+LineEnding
     +'  margin: 6px;'+LineEnding
@@ -221,7 +219,7 @@ begin
     +'border-width:'+FloatToStr(BorderWidthSlider.Position)+'px;';
 
   if GradientChkBox.Checked then
-    NewStyle+='background-image:linear-gradient('+BackgroundColor1+','+BackgroundColor2+')';
+    NewStyle+='background-image:linear-gradient('+BackgroundColor1+','+BackgroundColor2+');';
 
   Radius:=FloatToStr(BorderRadiusSlider.Position)+'px';
   s:='';

+ 2 - 1
src/base/fresnel.dom.pas

@@ -2981,7 +2981,8 @@ begin
         if NewStyleElements=nil then exit;
       end else begin
         if (NewStyleElements<>nil)
-            and FStyleElements.Equals(NewStyleElements) then exit;
+            and FStyleElements.Equals(NewStyleElements) then
+          exit;
       end;
       FreeAndNil(FStyleElements);
       FStyleElements:=NewStyleElements;

+ 1 - 1
src/skia/fresnel.skiarenderer.pas

@@ -779,7 +779,7 @@ begin
   SkPaint.setColor(FPColorToSkia(aColor));
   aTextBlob:=TSkTextBlob.MakeFromText(UnicodeString(aText),FreSkiaFont.SKFont);
   //SkPaint.MaskFilter:=TSkMaskFilter.MakeBlur(TSkBlurStyle.Normal,);
-  SkPaint.ImageFilter:=TSkImageFilter.MakeBlur(aRadius/2,aRadius/2);
+  SkPaint.ImageFilter:=TSkImageFilter.MakeBlur(aRadius,aRadius);
   X:=FOrigin.X+aLeft;
   Y:=FOrigin.Y+aTop - FreSkiaFont.SKMetrics.Ascent;
   Canvas.DrawTextBlob(aTextBlob, X, Y, SkPaint);