void KstTopLevelView::paint(KstPainter& p, const QRegion& bounds) { updateAlignment(p); #ifdef BENCHMARK QTime t; t.start(); #endif KstViewObject::paint(p, bounds); #ifdef BENCHMARK int x = t.elapsed(); kstdDebug() << " -> Parent class took " << x << "ms" << endl; #endif }
const TexturePtr& UINode::setImage (const std::string& texture) { _texture = loadTexture(texture); if (!hasImage()) return _texture; float w = getWidth(); if (w <= 0.0f) { w = getAutoWidth(); } float h = getHeight(); if (h <= 0.0f) { h = getAutoHeight(); } setSize(w, h); updateAlignment(); return _texture; }
void UINode::setSize (float w, float h) { _size.x = clamp(w, 0.0f, 1.0f); _size.y = clamp(h, 0.0f, 1.0f); updateAlignment(); }
void UINode::setAlignment (int align) { _align = align; updateAlignment(); }
void UINode::setPos (float x, float y) { _pos.x = clamp(x, 0.0f, 1.0f); _pos.y = clamp(y, 0.0f, 1.0f); updateAlignment(); }