Fix #221: Add grid_pos and grid_size properties for Grid children
UIDrawables placed in a Grid's children collection now have: - grid_pos: Position in tile coordinates (get/set) - grid_size: Size in tile coordinates (get/set) Raises RuntimeError if accessed when parent is not a Grid. UIGrid only gets grid_pos (grid_size conflicts with existing property). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6c5992f1c1
commit
14a6520593
10 changed files with 251 additions and 0 deletions
|
|
@ -448,6 +448,8 @@ PyGetSetDef UIArc::getsetters[] = {
|
|||
"Name for finding this element.", (void*)PyObjectsEnum::UIARC},
|
||||
{"pos", (getter)UIDrawable::get_pos, (setter)UIDrawable::set_pos,
|
||||
"Position as a Vector (same as center).", (void*)PyObjectsEnum::UIARC},
|
||||
{"grid_pos", (getter)UIDrawable::get_grid_pos, (setter)UIDrawable::set_grid_pos, "Position in grid tile coordinates (only when parent is Grid)", (void*)PyObjectsEnum::UIARC},
|
||||
{"grid_size", (getter)UIDrawable::get_grid_size, (setter)UIDrawable::set_grid_size, "Size in grid tile coordinates (only when parent is Grid)", (void*)PyObjectsEnum::UIARC},
|
||||
UIDRAWABLE_GETSETTERS,
|
||||
UIDRAWABLE_PARENT_GETSETTERS(PyObjectsEnum::UIARC),
|
||||
UIDRAWABLE_ALIGNMENT_GETSETTERS(PyObjectsEnum::UIARC),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue