Exemplo n.º 1
0
void Viewer::SetOrientation (Orientation o) {
    if (_orientation != o) {
        _orientation = o;

        Coord l, b, r, t;
        GetGraphicBox(l, b, r, t);
        Graphic* g = GraphicBlock::GetGraphic();

        if (
            _orientation == Normal ||
            _orientation == Portrait ||
            _orientation == Vertical
        ) {
            g->Rotate(90., l, b);
            g->Translate(t-b, 0.);

        } else if (
            _orientation == Rotated ||
            _orientation == Landscape ||
            _orientation == Horizontal
        ) {
            g->Rotate(-90., l, b);
            g->Translate(0., r-l);
        }
        GraphicBlock::Update();
    }
}
Exemplo n.º 2
0
void Viewer::Reorient () {
    if (
        _orientation == Rotated ||
        _orientation == Landscape ||
        _orientation == Horizontal
    ) {
        Coord l, b, r, t;
        GetGraphicBox(l, b, r, t);
        Graphic* g = GraphicBlock::GetGraphic();

        g->Rotate(-90., l, b);
        g->Translate(0., r-l);
    }
}