Hello, I would like to be able to know the current zoom level of the edit view, so that I can scale drawn items accordingly:
How can I do this? I wasn’t able to find the approriate method, and ChatGPT is currently at maximum capacity.
Hello, I would like to be able to know the current zoom level of the edit view, so that I can scale drawn items accordingly:
How can I do this? I wasn’t able to find the approriate method, and ChatGPT is currently at maximum capacity.
In a reporter plugin you get an options dictionary argument with a scale value. Divide your size by that scale to draw in physical units:
size = 12 # = 12 font units
size = 12 / scale # = 12 display points
Yes, but how do I get the scale?
I should specify that I am writing a tool plugin, not a reporter specifically.
Tools are lower-level, there you need to get the scale from the edit view yourself:
In Python this should be:
scale = self.editViewController().graphicView().scale()
# or
scale = self.controller.graphicView().scale()
I’m a total idiot. It’s as simple as Font.currentTab.scale
. Thanks!