Ejemplo n.º 1
0
// get bbox transformed to top
CBBox2D
CQIllustratorShape::
getFlatBBox() const
{
  CBBox2D bbox = getBBox();

  if (! bbox.isSet())
    return bbox;

  if (! parent_)
    return bbox;

  // if parent transform pby parent flat matric
  const CMatrix2D &m = parent_->getFlatMatrix();

  CPoint2D p1 = m*bbox.getLL();
  CPoint2D p2 = m*bbox.getLR();
  CPoint2D p3 = m*bbox.getUL();
  CPoint2D p4 = m*bbox.getUR();

  CBBox2D bbox1(p1, p2);

  bbox1 += p3;
  bbox1 += p4;

  return bbox1;
}
Ejemplo n.º 2
0
void
CQIllustratorShape::
drawSelect(CQIllustratorShapeDrawer *drawer)
{
  CBBox2D bbox = getFlatBBox();

  if (bbox.isSet()) {
    CPoint2D p1 = bbox.getLL();
    CPoint2D p2 = bbox.getLR();
    CPoint2D p3 = bbox.getUR();
    CPoint2D p4 = bbox.getUL();

    drawer->drawControlLine(p1, p2);
    drawer->drawControlLine(p2, p3);
    drawer->drawControlLine(p3, p4);
    drawer->drawControlLine(p4, p1);
  }
}