mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Dark mode
This commit is contained in:
@@ -12,16 +12,23 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : FontTextElement
|
||||
|
||||
void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end) const {
|
||||
void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end, bool native_look) const {
|
||||
if ((what & draw_as) != draw_as) return; // don't draw
|
||||
// text
|
||||
String text = content.substr(start - this->start, end - start);
|
||||
if (!text.empty() && text.GetChar(text.size() - 1) == _('\n')) {
|
||||
text = text.substr(0, text.size() - 1); // don't draw last \n
|
||||
}
|
||||
// draw
|
||||
// draw
|
||||
Color font_color = font->color;
|
||||
RealSize margin(0, 0);
|
||||
if (native_look) {
|
||||
font->color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
margin = RealSize(1., 0);
|
||||
}
|
||||
dc.SetFont(*font, scale);
|
||||
dc.DrawTextWithShadow(text, *font, rect.position());
|
||||
dc.DrawTextWithShadow(text, *font, rect.position() + margin);
|
||||
if (native_look) font->color = font_color;
|
||||
}
|
||||
|
||||
void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const {
|
||||
|
||||
Reference in New Issue
Block a user