My plugin displays images inline as phantoms. I’m trying to limit the image width to the viewport width.
My plugin processes files in an EventListener.on_load(view)
handler. I’m reading view.viewport_extent()
and view.layout_extent()
, but both return wrong(?) values. They return correct values when I call these methods in EventListener.on_save(view)
.
on_load: file_name test.cpp, layout_extent: (48.3828125, 1015.0), viewport_extent: (0.0, 0.0)
on_save: file_name test.cpp, layout_extent: (713.0, 645.2), viewport_extent: (713.0, 508.8)
Do you have any suggestion when/from where I should call viewport_extent()
?
It would be great if the documentation of
viewport_extent() would mention when it is possible to call this method. Same for layout_extent()
.