[TD]expose getScale() to Python

This commit is contained in:
wandererfan
2024-03-12 19:17:39 -04:00
committed by WandererFan
parent 2f45d5ef09
commit 0c534fc45b
2 changed files with 20 additions and 0 deletions

View File

@@ -20,6 +20,13 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getScale">
<Documentation>
<UserDocu>float scale = getScale(). Returns the correct scale for this view. Handles whether to
use this view's scale property or a parent's view (as in a projection group).
</UserDocu>
</Documentation>
</Methode>
<CustomAttributes />
</PythonExport>
</GenerateModel>

View File

@@ -78,6 +78,19 @@ PyObject* DrawViewPy::translateLabel(PyObject *args)
Py_Return;
}
//! return the correct scale for this view
PyObject* DrawViewPy::getScale(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) {
throw Py::TypeError("Do not understand passed parameter.");
}
DrawView* dv = getDrawViewPtr();
return PyFloat_FromDouble(dv->getScale());
}
PyObject *DrawViewPy::getCustomAttributes(const char* /*attr*/) const
{