mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-14 00:24:38 +00:00
Corrected two errors in the tablet management:
- when paint starts, the Zbuffer is initialized correctly - Wacom-compatible pen tip & eraser are correctly mapped to foreground and background color
This commit is contained in:
parent
1619df3cb0
commit
fb58e95fa1
@ -135,7 +135,12 @@ void EditPaintPlugin::mouseReleaseEvent(QMouseEvent * event, MeshModel &, GLArea
|
||||
void EditPaintPlugin::tabletEvent(QTabletEvent * event, MeshModel & , GLArea * gla)
|
||||
{
|
||||
event->accept();
|
||||
pushInputEvent(event->type(), event->pos(), event->modifiers(), event->pressure(), latest_event.button, gla);
|
||||
|
||||
// if event is down, clean zbuff
|
||||
if(event->type() == QEvent::TabletPress)
|
||||
if (zbuffer != NULL) delete zbuffer; zbuffer = NULL;
|
||||
|
||||
pushInputEvent(event->type(), event->pos(), event->modifiers(), event->pressure(), (event->pointerType() == QTabletEvent::Eraser)? Qt::RightButton : Qt::LeftButton, gla);
|
||||
gla->update();
|
||||
}
|
||||
|
||||
@ -241,9 +246,12 @@ void EditPaintPlugin::Decorate(MeshModel &m, GLArea * gla)
|
||||
case COLOR_PAINT:
|
||||
{
|
||||
painted_vertices.clear();
|
||||
QColor newcol = (latest_event.button == Qt::LeftButton) ?
|
||||
paintbox->getForegroundColor() :
|
||||
paintbox->getBackgroundColor();
|
||||
QColor newcol;
|
||||
|
||||
if(latest_event.button == Qt::LeftButton)
|
||||
newcol = paintbox->getForegroundColor();
|
||||
else
|
||||
newcol = paintbox->getBackgroundColor();
|
||||
color[0] = newcol.red(); color[1] = newcol.green();
|
||||
color[2] = newcol.blue(); color[3] = newcol.alpha();
|
||||
paintbox->getUndoStack()->beginMacro("Color Paint");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user