mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-15 09:04:36 +00:00
- fixed not showing loaded image bug
- fixed improper item removed bug
This commit is contained in:
parent
8f71bf4e60
commit
a666e1e498
@ -77,8 +77,8 @@ public :
|
||||
virtual void setScene(QGraphicsScene * scene)
|
||||
{
|
||||
QGraphicsView::setScene(scene);
|
||||
|
||||
scenegroup = new QGraphicsItemGroup(NULL/*, scene*/);
|
||||
QList<QGraphicsItem*> gil;
|
||||
scenegroup = scene->createItemGroup(gil);
|
||||
crosshair = new QGraphicsItemGroup(scenegroup);
|
||||
crosshair->setZValue(2);
|
||||
QPen pen;
|
||||
|
||||
@ -99,7 +99,8 @@ void Paintbox::on_switch_colors_clicked()
|
||||
|
||||
void Paintbox::setClonePixmap(QImage & image)
|
||||
{
|
||||
if (item != NULL) getCloneScene()->removeItem(item);
|
||||
if ((item != NULL) && (getCloneScene()->items().contains(item)))
|
||||
getCloneScene()->removeItem(item);
|
||||
item = getCloneScene()->addPixmap(QPixmap::fromImage(image));
|
||||
item->setParentItem(clone_source_view->scenegroup);
|
||||
item->setPos(0, 0);
|
||||
@ -142,7 +143,8 @@ void Paintbox::loadClonePixmap()
|
||||
if (!s.isNull())
|
||||
{
|
||||
QPixmap pixmap(s);
|
||||
if (item != NULL) getCloneScene()->removeItem(item);
|
||||
if ((item != NULL) && (getCloneScene()->items().contains(item)))
|
||||
getCloneScene()->removeItem(item);
|
||||
item = getCloneScene()->addPixmap(pixmap);
|
||||
item->setParentItem(clone_source_view->scenegroup);
|
||||
setPixmapDelta(pixmap.width()/2.0, pixmap.height()/2.0);
|
||||
@ -190,7 +192,8 @@ void Paintbox::restorePreviousType()
|
||||
|
||||
void Paintbox::refreshBrushPreview()
|
||||
{
|
||||
if (item != NULL) brush_viewer->scene()->removeItem(item);
|
||||
if ((item != NULL) && (brush_viewer->scene()->items().contains(item)))
|
||||
brush_viewer->scene()->removeItem(item);
|
||||
|
||||
item = brush_viewer->scene()->addPixmap(QPixmap::fromImage(
|
||||
raster(getBrush(), (int) ((brush_viewer->width()-2) * size_slider->value() / 100.0),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user