本文整理汇总了C++中Viewport::damage方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::damage方法的具体用法?C++ Viewport::damage怎么用?C++ Viewport::damage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::damage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invalidate
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
}
示例2: damage
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 );
}
示例3: setFocus
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
}