Recompute property browser viewport on resize.
Before this commit, resizing the property browser would cut off the rows at the bottom, or else add black space, until next refresh. This could be perhaps more elegantly done by adding an onResize event but given that each of them would be followed by onRender anyway, it seems there's no benefit to adding onResize.pull/507/head
parent
54015b6777
commit
f0359556d8
|
@ -563,7 +563,11 @@ void TextWindow::Show() {
|
|||
}
|
||||
}
|
||||
|
||||
if(window) {
|
||||
if(window) Resize();
|
||||
}
|
||||
|
||||
void TextWindow::Resize()
|
||||
{
|
||||
double width, height;
|
||||
window->GetContentSize(&width, &height);
|
||||
|
||||
|
@ -578,7 +582,6 @@ void TextWindow::Show() {
|
|||
window->SetScrollbarVisible(top[rows - 1] + 1 > halfRows);
|
||||
window->Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
void TextWindow::DrawOrHitTestIcons(UiCanvas *uiCanvas, TextWindow::DrawOrHitHow how,
|
||||
double mx, double my)
|
||||
|
@ -909,6 +912,8 @@ void TextWindow::Paint() {
|
|||
|
||||
double width, height;
|
||||
window->GetContentSize(&width, &height);
|
||||
if(halfRows != (int)height / (LINE_HEIGHT/2))
|
||||
Resize();
|
||||
|
||||
Camera camera = {};
|
||||
camera.width = width;
|
||||
|
|
Loading…
Reference in New Issue