コード例 #1
0
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
}
コード例 #2
0
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;
}
コード例 #3
0
void UINode::setSize (float w, float h)
{
	_size.x = clamp(w, 0.0f, 1.0f);
	_size.y = clamp(h, 0.0f, 1.0f);
	updateAlignment();
}
コード例 #4
0
void UINode::setAlignment (int align)
{
	_align = align;
	updateAlignment();
}
コード例 #5
0
void UINode::setPos (float x, float y)
{
	_pos.x = clamp(x, 0.0f, 1.0f);
	_pos.y = clamp(y, 0.0f, 1.0f);
	updateAlignment();
}