@@ -21,7 +21,7 @@ func DrawShadowedRectangle(canvas *gg.Context, x, y, w, h, r, sigma float64, ox,
2121 one .DrawRoundedRectangle (x , y , w , h , r )
2222 one .SetColor (shadowcolor )
2323 one .Fill ()
24- canvas .DrawImage (imaging .Blur (one .Image (), sigma ), ox , oy )
24+ canvas .DrawImage (imaging .Blur (one .Image (), sigma ), int ( x ) + ox , int ( y ) + oy )
2525}
2626
2727// DrawShadowedString 绘制带阴影的文字
@@ -33,7 +33,7 @@ func DrawShadowedString(canvas *gg.Context, s, fontfile string, x, y, point, sig
3333 }
3434 one .SetColor (shadowcolor )
3535 one .DrawString (s , x , y )
36- canvas .DrawImage (imaging .Blur (one .Image (), sigma ), ox , oy )
36+ canvas .DrawImage (imaging .Blur (one .Image (), sigma ), int ( x ) + ox , int ( y ) + oy )
3737 err = canvas .LoadFontFace (fontfile , point )
3838 if err != nil {
3939 return
@@ -52,7 +52,7 @@ func DrawShadowedStringAnchored(canvas *gg.Context, s, fontfile string, x, y, po
5252 }
5353 one .SetColor (shadowcolor )
5454 one .DrawStringAnchored (s , x , y , ax , ay )
55- canvas .DrawImage (imaging .Blur (one .Image (), sigma ), ox , oy )
55+ canvas .DrawImage (imaging .Blur (one .Image (), sigma ), int ( x ) + ox , int ( y ) + oy )
5656 err = canvas .LoadFontFace (fontfile , point )
5757 if err != nil {
5858 return
0 commit comments