Blender Font (BLF): add length argument to string width/height functions

This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
This commit is contained in:
2013-12-02 20:33:45 +11:00
parent f64ae4cbe5
commit 1815225faa
22 changed files with 109 additions and 131 deletions

View File

@@ -180,7 +180,7 @@ static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
if (!PyArg_ParseTuple(args, "is:blf.dimensions", &fontid, &text))
return NULL;
BLF_width_and_height(fontid, text, &r_width, &r_height);
BLF_width_and_height(fontid, text, INT_MAX, &r_width, &r_height);
ret = PyTuple_New(2);
PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(r_width));