13
0

Canvas: size request using preferred_size() callstack

This commit is contained in:
Paul Davis 2020-06-10 19:40:17 -06:00
parent 5650d4f5bb
commit 504d8fdab3

View File

@ -1478,9 +1478,14 @@ GtkCanvasViewport::scrolled ()
void
GtkCanvasViewport::on_size_request (Gtk::Requisition* req)
{
/* force the canvas to size itself */
// _canvas.root()->bounding_box();
Duple minimum;
Duple natural;
req->width = 16;
req->height = 16;
cerr << "GCV::osr()\n";
_canvas.root()->preferred_size (minimum, natural);
cerr << "size canvas to " << natural << endl;
_canvas.request_size (natural);
req->width = natural.width();
req->height = natural.height();
}