mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
implemented resampled text ("high quality")
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@87 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <render/symbol/viewer.hpp>
|
||||
#include <gui/util.hpp> // clearDC_black
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(SymbolPartP);
|
||||
|
||||
@@ -29,12 +30,7 @@ MemoryDCP getTempDC(DC& dc) {
|
||||
Bitmap buffer(s.GetWidth(), s.GetHeight(), 1);
|
||||
MemoryDCP newDC(new wxMemoryDC);
|
||||
newDC->SelectObject(buffer);
|
||||
// On windows 9x it seems that bitmaps are not black by default
|
||||
#if !BITMAPS_DEFAULT_BLACK
|
||||
newDC->SetPen(*wxTRANSPARENT_PEN);
|
||||
newDC->SetBrush(*wxBLACK_BRUSH);
|
||||
newDC->DrawRectangle(0, 0, s.GetWidth(), s.GetHeight());
|
||||
#endif
|
||||
clearDC_black(*newDC);
|
||||
return newDC;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ void TextElements::draw(RotatedDC& dc, double scale, const RealRect& rect, const
|
||||
size_t end_ = min(end, e->end);
|
||||
if (start_ < end_) {
|
||||
e->draw(dc, scale,
|
||||
RealRect(rect.position.x + xs[start_-start] - xs[0], rect.position.y,
|
||||
xs[end_-start] - xs[start_-start], rect.size.height),
|
||||
RealRect(rect.x + xs[start_-start] - xs[0], rect.y,
|
||||
xs[end_-start] - xs[start_-start], rect.height),
|
||||
xs + start_ - start, what, start_, end_);
|
||||
}
|
||||
if (end <= e->end) return; // nothing can be after this
|
||||
|
||||
@@ -27,11 +27,11 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co
|
||||
// draw shadow
|
||||
if (font->hasShadow()) {
|
||||
dc.SetTextForeground(font->shadow_color);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position + font->shadow_displacement);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position() + font->shadow_displacement);
|
||||
}
|
||||
// draw
|
||||
dc.SetTextForeground(font->color);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position());
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user