Esempio n. 1
0
void RowArea::paintEvent(QPaintEvent *event)
{
	QRect toBeUpdated = event->rect();

	QPainter p(this);

	int r0, r1; // range di righe visibili
	r0 = m_viewer->yToRow(toBeUpdated.top());
	r1 = m_viewer->yToRow(toBeUpdated.bottom());

	p.setClipRect(toBeUpdated);

	//fill background
	p.fillRect(toBeUpdated, m_viewer->getBGColor());

	if (TApp::instance()->getCurrentFrame()->isEditingScene())
		//current frame
		drawCurrentRowGadget(p, r0, r1);

	drawRows(p, r0, r1);

	if (TApp::instance()->getCurrentFrame()->isEditingScene() && Preferences::instance()->isOnionSkinEnabled())
			drawOnionSkinSelection(p);

	drawPlayRange(p, r0, r1);
}
void FrameHeadGadget::draw(QPainter &p, const QColor &lightColor, const QColor &darkColor)
{
	if (!Preferences::instance()->isOnionSkinEnabled())
		return;
	drawOnionSkinSelection(p, lightColor, darkColor);
}