add 'add_stroke_effect' script function

This commit is contained in:
GenevensiS
2026-01-14 11:48:17 +01:00
parent d10a71e925
commit 8afd412021
10 changed files with 128 additions and 111 deletions
+3 -2
View File
@@ -220,8 +220,9 @@ void RotatedDC::DrawText(const String& text, const RealPoint& pos, Color color,
void RotatedDC::DrawTextWithShadowOrStroke(const String& text, const Font& font, const RealPoint& pos, double scale, double stretch) {
double s_scale = scale * dc.GetFont().GetPointSize() / text_scaling / 15.;
if (font.hasShadow() && !font.hasStroke()) {
DrawText(text, pos + RealSize(font.shadow_displacement_x, font.shadow_displacement_y) * scale, font.shadow_color, lround(font.shadow_blur * s_scale), Color(0,0,0), 0, stretch);
if (font.hasShadow() && !font.hasStroke()) {
RealSize shadow_displacement = trInvS(RealSize(font.shadow_displacement_x, font.shadow_displacement_y) * s_scale);
DrawText(text, pos + shadow_displacement, font.shadow_color, lround(font.shadow_blur * s_scale), Color(0,0,0), 0, stretch);
}
DrawText(text, pos, font.color, lround(font.stroke_blur * s_scale), font.stroke_color, lround(font.stroke_radius * s_scale), stretch);
}