void PageBoundary::ToggleOrientation () { int nw = pageheight; int nh = pagewidth; pagewidth = nw; pageheight = nh; uncacheParents(); }
void PageBoundary::SetLandscape () { int nw = max(pagewidth, pageheight); int nh = min(pagewidth, pageheight); pagewidth = nw; pageheight = nh; uncacheParents(); }
void Picture::InsertAfter (Iterator i, Graphic* g) { invalidateCachesGraphic(g); Elem(i)->Prepend(new UList(g)); setParent(g, this); uncacheExtent(); uncacheParents(); }
void Graphic::Translate (float dx, float dy) { if (dx != 0 || dy != 0) { if (_t == nil) { _t = new Transformer; } _t->Translate(dx, dy); uncacheParents(); } }
void Graphic::SetTransformer (Transformer* t) { if (t != _t) { Unref(_t); if (t != nil) { Ref(t); } _t = t; uncacheParents(); } }
void Picture::Remove (Iterator& i) { UList* doomed = Elem(i); Graphic* g = graphic(doomed); Next(i); unsetParent(g); _kids->Remove(doomed); delete doomed; uncacheExtent(); uncacheParents(); }
void Graphic::Scale (float sx, float sy, float cx, float cy) { float ncx, ncy; if (sx != 1 || sy != 1) { if (_t == nil) { _t = new Transformer; } Transformer parents; parentXform(parents); parents.InvTransform(cx, cy, ncx, ncy); if (ncx != 0 || ncy != 0) { _t->Translate(-ncx, -ncy); _t->Scale(sx, sy); _t->Translate(ncx, ncy); } else { _t->Scale(sx, sy); } uncacheParents(); } }
void Graphic::Rotate (float angle, float cx, float cy) { float mag = (angle < 0) ? -angle : angle; float ncx, ncy; if ((mag - int(mag)) != 0 || int(mag)%360 != 0) { if (_t == nil) { _t = new Transformer; } Transformer parents; parentXform(parents); parents.InvTransform(cx, cy, ncx, ncy); if (ncx != 0 || ncy != 0) { _t->Translate(-ncx, -ncy); _t->Rotate(angle); _t->Translate(ncx, ncy); } else { _t->Rotate(angle); } uncacheParents(); } }
void Picture::Prepend (Graphic* g0, Graphic* g1, Graphic* g2, Graphic* g3) { if (g3 != nil) { invalidateCachesGraphic(g3); _kids->Prepend(new UList(g3)); setParent(g3, this); } if (g2 != nil) { invalidateCachesGraphic(g2); _kids->Prepend(new UList(g2)); setParent(g2, this); } if (g1 != nil) { invalidateCachesGraphic(g1); _kids->Prepend(new UList(g1)); setParent(g1, this); } invalidateCachesGraphic(g0); _kids->Prepend(new UList(g0)); setParent(g0, this); uncacheExtent(); uncacheParents(); }
void Graphic::invalidateCaches() { uncacheParents(); uncacheExtent(); uncacheChildren(); }
void Picture::Remove (Graphic* g) { unsetParent(g); _kids->Delete(g); uncacheExtent(); uncacheParents(); }