Skip to content

Commit 6fb1f65

Browse files
committed
Set font size when resize happens
1 parent 464f3c6 commit 6fb1f65

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/chart/main/chart.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ Chart::Chart() :
4040
void Chart::setBoundRect(const Geom::Rect &rect)
4141
{
4242
if (actPlot) {
43-
actPlot->getStyle().setup();
44-
layout.setBoundary(rect,
45-
actPlot->getStyle(),
46-
actPlot->getOptions());
43+
auto &style = actPlot->getStyle();
44+
style.setup();
45+
if (!actStyles.fontSize)
46+
computedStyles.fontSize = style.fontSize = Gfx::Length{
47+
Styles::Sheet::baseFontSize(rect.size, true)};
48+
layout.setBoundary(rect, style, actPlot->getOptions());
4749
}
4850
else {
4951
layout.setBoundary(rect,

test/qtest/window.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,4 @@ bool Window::eventFilter(QObject *, QEvent *event)
9696
}
9797
return false;
9898
}
99-
void Window::resizeEvent(QResizeEvent *)
100-
{
101-
try {
102-
chart.getChart().getChart().setKeyframe();
103-
chart.getChart().getChart().animate();
104-
}
105-
catch (...) {
106-
}
107-
}
99+
void Window::resizeEvent(QResizeEvent *) { update(); }

0 commit comments

Comments
 (0)