mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
add 'add_stroke_effect' script function
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user