本文整理汇总了C++中Painter::popTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Painter::popTransform方法的具体用法?C++ Painter::popTransform怎么用?C++ Painter::popTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Painter
的用法示例。
在下文中一共展示了Painter::popTransform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
/**
* Draw a container and all its subcomponent
* Adjust coordinates with his position
*/
void Container::draw(Painter & painter)
{
painter.setBrushColor(::Color::white);
if(draw_frame)
drawFrame(painter);
painter.pushTransform(area.min);
std::list<Component *>::iterator i;
for(i = components.begin(); i != components.end(); i++)
(*i)->draw(painter);
painter.popTransform();
}
示例2: assert
void
Component::drawChild(Child& child, Painter& painter)
{
assert(child.getComponent() != 0);
if(child.useClipRect) {
painter.setClipRectangle(child.clipRect);
}
if(child.position != Vector2(0, 0)) {
painter.pushTransform();
painter.translate(child.position);
}
child.component->draw(painter);
if(child.position != Vector2(0, 0)) {
painter.popTransform();
}
if(child.useClipRect) {
painter.clearClipRectangle();
}
}
示例3: if
void
Button::draw(Painter& painter)
{
switch(state) {
case STATE_CLICKED:
if(comp_clicked().isEnabled()) {
drawChild(comp_clicked(), painter);
break;
}
// fallthrough
case STATE_HOVER:
if(comp_hover().isEnabled()) {
drawChild(comp_hover(), painter);
break;
}
// fallthrough
case STATE_NORMAL:
drawChild(comp_normal(), painter);
break;
default:
assert(false);
}
if(lowerOnClick)
{
if(state == STATE_CLICKED)
{
painter.pushTransform();
painter.translate(Vector2(3,3));
}
else if(state == STATE_HOVER)
{
painter.pushTransform();
painter.translate(Vector2(1,1));
}
}
if(comp_caption().isEnabled())
{ drawChild(comp_caption(), painter);}
if(lowerOnClick && (state==STATE_CLICKED || state == STATE_HOVER))
{ painter.popTransform();}
}