src/ui/canvas.cpp

Fri, 07 Feb 2020 02:01:21 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Fri, 07 Feb 2020 02:01:21 +0200
changeset 49
d56cc7387dad
parent 48
3c10f0e2fbe0
child 51
1a9eac27698d
permissions
-rw-r--r--

wrote the id color in terms of the id value in the shader now that I can get the id to the shader properly

#include <QMouseEvent>
#include "canvas.h"

Canvas::Canvas(
	Model* model,
	DocumentManager* documents,
	const ldraw::ColorTable& colorTable,
	QWidget* parent) :
	PartRenderer{model, documents, colorTable, parent}
{
	this->setMouseTracking(true);
}

void Canvas::mouseMoveEvent(QMouseEvent* event)
{
	const ldraw::Id id = this->pick(event->pos());
	this->newStatusText("Selected: %1"_q.arg(id.value));
	this->setHighlight(id);
	PartRenderer::mouseMoveEvent(event);
}

mercurial