void Border::invalidate(Viewport & v, const Allocation & a) { Twips t = a.getTop(); Twips l = a.getLeft(); Twips h = a.getHeight(); Twips w = a.getWidth(); Twips d = d_thickness; // Zeichne einen Rahmen um a herum nach innen ausdehnend um thickness. v.damage( Allocation( l, t, w, d ) ); // oben v.damage( Allocation( l, t, d, h ) ); // links v.damage( Allocation( l + w - d, t, d, h ) ); // rechts v.damage( Allocation( l, t + h - d, w, d ) ); // unten }
void SelectorCmd::damage() { const Coord left = Math::_min( d_left, d_right ); const Coord top = Math::_min( d_top, d_bottom ); const Coord right = Math::_max( d_left, d_right ); const Coord bottom = Math::_max( d_top, d_bottom ); Viewport* v = getHandler()->getViewport(); Allocation a1( left, top, right - left + 20, 20 ); Allocation a2( left, top, 20, bottom - top + 20 ); Allocation a3( left, bottom, right - left + 20, 20 ); Allocation a4( right, top, 20, bottom - top + 20 ); v->damage( a1 ); v->damage( a2 ); v->damage( a3 ); v->damage( a4 ); }
void SpecViewer::setFocus(bool on) { if( d_focus == on ) return; d_focus = on; Viewport* v = getViewport(); assert( v ); const Allocation& a = d_area->getAllocation(); Coord t = a.getTop(); Coord l = a.getLeft(); Coord h = a.getHeight(); Coord w = a.getWidth(); // Zeichne einen Rahmen um a herum nach innen ausdehnend um thickness. v->damage( l, t, w, TwipsPerPoint ); // oben v->damage( l, t, TwipsPerPoint, h ); // links v->damage( l + w - s_off - 2 * TwipsPerPoint, t, 3 * TwipsPerPoint, h ); // rechts v->damage( l, t + h - s_off - 2 * TwipsPerPoint, w, 3 * TwipsPerPoint ); // unten }