Question
Getting/Setting the XY Values of a Frame
Hello,
Is there a direct way to get/set the XY values of a frame ?
Currently I use the following (pared-down down code for simplicity) which is really complex and relies on the page height/width and whether pages are facing or not. It seems unnecessariuly complex.
Is there a more direct way ?
Very best regards,
Olivier
InterfacePtr<IGeometry> itemGeometry(curBoxIDRef, UseDefaultIID());
gBoxRect = itemGeometry->GetPathBoundingBox(InnerToParentMatrix(itemGeometry));
if (IniSettings.FacingPages)
{
// left page object bounding boxes need to be shifted by a full page width
if (pcr->pageNum % 2 == 0)
{
gBoxRect.Left(gBoxRect.left + ToPMReal(IniSettings.PageWidth));
gBoxRect.Right(gBoxRect.right + ToPMReal(IniSettings.PageWidth));
}
}
else
{
// page object bounding boxes need to be shifted to the right by a half page width
gBoxRect.Left(gBoxRect.left + ToPMReal(IniSettings.PageWidth / 2.0));
gBoxRect.Right(gBoxRect.right + ToPMReal(IniSettings.PageWidth / 2.0));
}
// 2024-12-18: all box vert positions are shifted by 1/2 page length
gBoxRect.Top(gBoxRect.top + ToPMReal(IniSettings.PageLength / 2.0));
gBoxRect.Bottom(gBoxRect.bottom + ToPMReal(IniSettings.PageLength / 2.0));
