mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
A bit of refactoring:
- common code of ChoiceValueViewer and MultipleChoiceValueViewer put into functions - RotatedDC can now draw text with shadow. - DECLARE_STYLE_TYPE macro and friends do slightly more. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@788 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -216,6 +216,15 @@ void RotatedDC::DrawText (const String& text, const RealPoint& pos, int blur_ra
|
||||
}
|
||||
}
|
||||
|
||||
void RotatedDC::DrawTextWithShadow(const String& text, const Font& font, const RealPoint& pos, double scale, double stretch) {
|
||||
if (font.hasShadow()) {
|
||||
SetTextForeground(font.shadow_color);
|
||||
DrawText(text, pos + font.shadow_displacement * scale, 0, 1, stretch);
|
||||
}
|
||||
SetTextForeground(font.color);
|
||||
DrawText(text, pos, 0, 1, stretch);
|
||||
}
|
||||
|
||||
void RotatedDC::DrawBitmap(const Bitmap& bitmap, const RealPoint& pos) {
|
||||
if (angle == 0) {
|
||||
RealPoint p_ext = tr(pos);
|
||||
|
||||
@@ -163,7 +163,10 @@ class RotatedDC : public Rotation {
|
||||
|
||||
// --------------------------------------------------- : Drawing
|
||||
|
||||
/// Draw text
|
||||
void DrawText (const String& text, const RealPoint& pos, int blur_radius = 0, int boldness = 1, double stretch = 1.0);
|
||||
/// Draw text with the shadow and color settings of the given font
|
||||
void DrawTextWithShadow(const String& text, const Font& font, const RealPoint& pos, double scale = 1.0, double stretch = 1.0);
|
||||
/// Draw abitmap, it must already be zoomed!
|
||||
void DrawBitmap(const Bitmap& bitmap, const RealPoint& pos);
|
||||
/// Draw an image using the given combining mode, the image must already be zoomed!
|
||||
|
||||
Reference in New Issue
Block a user