Fix sprite transparency not updating when changing object event graphics
This commit is contained in:
parent
9c8fb686eb
commit
2e29e19605
1 changed files with 2 additions and 3 deletions
|
@ -1358,9 +1358,6 @@ void Editor::displayMapEvents() {
|
||||||
DraggablePixmapItem *Editor::addMapEvent(Event *event) {
|
DraggablePixmapItem *Editor::addMapEvent(Event *event) {
|
||||||
DraggablePixmapItem *object = new DraggablePixmapItem(event, this);
|
DraggablePixmapItem *object = new DraggablePixmapItem(event, this);
|
||||||
this->redrawObject(object);
|
this->redrawObject(object);
|
||||||
if (!event->usingSprite) {
|
|
||||||
object->setOpacity(0.7);
|
|
||||||
}
|
|
||||||
events_group->addToGroup(object);
|
events_group->addToGroup(object);
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
@ -1841,6 +1838,8 @@ QList<DraggablePixmapItem *> *Editor::getObjects() {
|
||||||
|
|
||||||
void Editor::redrawObject(DraggablePixmapItem *item) {
|
void Editor::redrawObject(DraggablePixmapItem *item) {
|
||||||
if (item) {
|
if (item) {
|
||||||
|
qreal opacity = item->event->usingSprite ? 1.0 : 0.7;
|
||||||
|
item->setOpacity(opacity);
|
||||||
item->setPixmap(item->event->pixmap.copy(item->event->frame * item->event->spriteWidth % item->event->pixmap.width(), 0, item->event->spriteWidth, item->event->spriteHeight));
|
item->setPixmap(item->event->pixmap.copy(item->event->frame * item->event->spriteWidth % item->event->pixmap.width(), 0, item->event->spriteWidth, item->event->spriteHeight));
|
||||||
item->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
|
item->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
|
||||||
if (selected_events && selected_events->contains(item)) {
|
if (selected_events && selected_events->contains(item)) {
|
||||||
|
|
Loading…
Reference in a new issue