Skip to content

Commit

Permalink
Made consecutive edits to map properties merge together
Browse files Browse the repository at this point in the history
Like already happens for the properties of most other data types.

The new properties view made it extra noticeable that each change became
its own undo command.
  • Loading branch information
bjorn committed Oct 29, 2024
1 parent dd0784a commit 2177fac
Show file tree
Hide file tree
Showing 10 changed files with 455 additions and 389 deletions.
10 changes: 8 additions & 2 deletions src/libtiled/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ class TILEDSHARED_EXPORT Map : public Object
QString exportFormat;

enum Property {
TileWidthProperty,
TileHeightProperty,
TileSizeProperty,
InfiniteProperty,
HexSideLengthProperty,
StaggerAxisProperty,
Expand Down Expand Up @@ -212,6 +211,7 @@ class TILEDSHARED_EXPORT Map : public Object
void setTileHeight(int height);

QSize tileSize() const;
void setTileSize(QSize size);

bool infinite() const;
void setInfinite(bool infinite);
Expand Down Expand Up @@ -455,6 +455,12 @@ inline QSize Map::tileSize() const
return QSize(mParameters.tileWidth, mParameters.tileHeight);
}

inline void Map::setTileSize(QSize size)
{
mParameters.tileWidth = size.width();
mParameters.tileHeight = size.height();
}

inline bool Map::infinite() const
{
return mParameters.infinite;
Expand Down
1 change: 0 additions & 1 deletion src/tiled/changelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "changeevents.h"
#include "document.h"
#include "layer.h"
#include "map.h"

#include <QCoreApplication>

Expand Down
Loading

0 comments on commit 2177fac

Please sign in to comment.