mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Add hack to fetch caption if value is empty
This commit is contained in:
@@ -34,7 +34,16 @@ void InfoValueViewer::draw(RotatedDC& dc) {
|
|||||||
style().padding_top,
|
style().padding_top,
|
||||||
-style().padding_left - style().padding_right,
|
-style().padding_left - style().padding_right,
|
||||||
-style().padding_top - style().padding_bottom
|
-style().padding_top - style().padding_bottom
|
||||||
);
|
);
|
||||||
RealSize size = dc.GetTextExtent(value().value);
|
// for some reason, while inside the style tab, this value is empty
|
||||||
dc.DrawText(value().value, align_in_rect(style().alignment, size, rect));
|
// so as a hack for now, if the value is empty, go fetch the caption instead
|
||||||
|
if (value().value.empty()) {
|
||||||
|
RealSize size = dc.GetTextExtent(field().caption.get());
|
||||||
|
dc.DrawText(field().caption.get(), align_in_rect(style().alignment, size, rect));
|
||||||
|
}
|
||||||
|
// this is what should happen
|
||||||
|
else {
|
||||||
|
RealSize size = dc.GetTextExtent(value().value);
|
||||||
|
dc.DrawText(value().value, align_in_rect(style().alignment, size, rect));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user