Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ability to change image and object layer properties #4148

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/tiled/changeimagelayerproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class ChangeImageLayerTransparentColor : public ChangeValue<ImageLayer, QColor>
QList<ImageLayer *> imageLayers,
const QColor &newColor);

int id() const override { return Cmd_ChangeImageLayerTransparentColor; }

private:
QColor getValue(const ImageLayer *imageLayer) const override;
void setValue(ImageLayer *imageLayer, const QColor &value) const override;
Expand All @@ -51,6 +53,8 @@ class ChangeImageLayerImageSource : public ChangeValue<ImageLayer, QUrl>
QList<ImageLayer *> imageLayers,
const QUrl &imageSource);

int id() const override { return Cmd_ChangeImageLayerImageSource; }

private:
QUrl getValue(const ImageLayer *imageLayer) const override;
void setValue(ImageLayer *imageLayer, const QUrl &value) const override;
Expand Down
4 changes: 4 additions & 0 deletions src/tiled/changeobjectgroupproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class ChangeObjectGroupColor : public ChangeValue<ObjectGroup, QColor>
QList<ObjectGroup *> objectGroups,
const QColor &newColor);

int id() const override { return Cmd_ChangeObjectGroupColor; }

private:
QColor getValue(const ObjectGroup *objectGroup) const override;
void setValue(ObjectGroup *objectGroup, const QColor &value) const override;
Expand All @@ -61,6 +63,8 @@ class ChangeObjectGroupDrawOrder : public ChangeValue<ObjectGroup, ObjectGroup::
QList<ObjectGroup *> objectGroups,
ObjectGroup::DrawOrder newDrawOrder);

int id() const override { return Cmd_ChangeObjectGroupDrawOrder; }

private:
ObjectGroup::DrawOrder getValue(const ObjectGroup *objectGroup) const override;
void setValue(ObjectGroup *objectGroup, const ObjectGroup::DrawOrder &value) const override;
Expand Down
5 changes: 2 additions & 3 deletions src/tiled/propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ class LayerProperties : public ObjectProperties
template <class T>
QList<T*> selectedLayersOfType(Layer::TypeFlag typeFlag)
{
if (mDocument)
if (!mDocument)
return {};

QList<T*> result;
Expand Down Expand Up @@ -1212,9 +1212,8 @@ class ImageLayerProperties : public LayerProperties
emit mImageProperty->valueChanged();
if (layerChange.properties & ImageLayerChangeEvent::TransparentColorProperty)
emit mTransparentColorProperty->valueChanged();
if (layerChange.properties & ImageLayerChangeEvent::RepeatProperty) {
if (layerChange.properties & ImageLayerChangeEvent::RepeatProperty)
emit mRepeatProperty->valueChanged();
}
}

ImageLayer *imageLayer() const
Expand Down
4 changes: 4 additions & 0 deletions src/tiled/undocommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ namespace Tiled {
*/
enum UndoCommands {
Cmd_ChangeClassName,
Cmd_ChangeImageLayerImageSource,
Cmd_ChangeImageLayerRepeatX,
Cmd_ChangeImageLayerRepeatY,
Cmd_ChangeImageLayerTransparentColor,
Cmd_ChangeLayerBlendMode,
Cmd_ChangeLayerLocked,
Cmd_ChangeLayerName,
Expand All @@ -54,6 +56,8 @@ enum UndoCommands {
Cmd_ChangeMapStaggerAxis,
Cmd_ChangeMapStaggerIndex,
Cmd_ChangeMapTileSize,
Cmd_ChangeObjectGroupColor,
Cmd_ChangeObjectGroupDrawOrder,
Cmd_ChangeSelectedArea,
Cmd_ChangeTileImageRect,
Cmd_ChangeTileProbability,
Expand Down
Loading