Skip to content

Commit

Permalink
Merge branch '1.8'
Browse files Browse the repository at this point in the history
Conflicts:
	NEWS.md
	src/tiled/tiled.qbs
  • Loading branch information
bjorn committed Mar 8, 2022
2 parents 9bacf4f + 69cd4a0 commit 7ea7bd8
Show file tree
Hide file tree
Showing 20 changed files with 190 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-20.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install qt5-default qttools5-dev-tools zlib1g-dev qtdeclarative5-dev qtdeclarative5-private-dev qbs python3-dev
sudo apt install qt5-default qttools5-dev-tools zlib1g-dev qtdeclarative5-dev qtdeclarative5-private-dev qtbase5-private-dev qbs python3-dev
- name: Setup qbs
run: |
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
* Raised minimum supported Qt version from 5.6 to 5.12 (drops Windows XP support)
* Raised minimum C++ version to C++17

### Unreleased 1.8 patch

* Fixed automatic tool switching after deleting layers
* Fixed map bounding rectangle for infinite isometric maps
* Fixed tile selection to not get removed when deleting (#3281)
* Fixed custom types not being usable without opening a project (#3295)
* Scripting: Avoid possible crash due to garbage collection (#3290)
* Scripting: Fixed missing null check in Tileset.loadFromImage and Tile.setImage
* Scripting: Initialize tile layer size also when added as part of a group layer (#3291)
* macOS: Fixed main window expanding with many open files (#1047)
* Qt 6: Fixed captured or erased area when dragging backwards

### Tiled 1.8.2 (18 February 2022)

* Fixed deactivating of tools when no layer is selected (avoids crash)
Expand Down
47 changes: 29 additions & 18 deletions docs/reference/tmx-map-format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ rendered by Tiled.
The ``staggered`` orientation refers to an isometric map using staggered
axes.

The tilesets used by the map should always be listed before the layers.

Can contain at most one: :ref:`tmx-properties`,
:ref:`tmx-editorsettings` (since 1.3)

Expand Down Expand Up @@ -390,9 +392,10 @@ All :ref:`tmx-tileset` tags shall occur before the first :ref:`tmx-layer` tag
so that parsers may rely on having the tilesets before needing to resolve
tiles.

- **id:** Unique ID of the layer. Each layer that added to a map gets
a unique id. Even if a layer is deleted, no layer ever gets the same
ID. Can not be changed in Tiled. (since Tiled 1.2)
- **id:** Unique ID of the layer (defaults to 0, with valid IDs being at least
1). Each layer that added to a map gets a unique id. Even if a layer is
deleted, no layer ever gets the same ID. Can not be changed in Tiled.
(since Tiled 1.2)
- **name:** The name of the layer. (defaults to "")
- *x:* The x coordinate of the layer in tiles. Defaults to 0 and can not be changed in Tiled.
- *y:* The y coordinate of the layer in tiles. Defaults to 0 and can not be changed in Tiled.
Expand Down Expand Up @@ -472,12 +475,12 @@ should generally be avoided.
<objectgroup>
-------------

- **id:** Unique ID of the layer. Each layer that added to a map gets
a unique id. Even if a layer is deleted, no layer ever gets the same
ID. Can not be changed in Tiled. (since Tiled 1.2)
- **id:** Unique ID of the layer (defaults to 0, with valid IDs being at least
1). Each layer that added to a map gets a unique id. Even if a layer is
deleted, no layer ever gets the same ID. Can not be changed in Tiled.
(since Tiled 1.2)
- **name:** The name of the object group. (defaults to "")
- **color:** The color used to display the objects in this group. (defaults
to gray ("#a0a0a4"))
- **color:** The color used to display the objects in this group. (optional)
- *x:* The x coordinate of the object group in tiles. Defaults to 0 and
can no longer be changed in Tiled.
- *y:* The y coordinate of the object group in tiles. Defaults to 0 and
Expand Down Expand Up @@ -508,9 +511,10 @@ Can contain any number: :ref:`tmx-object`
<object>
~~~~~~~~

- **id:** Unique ID of the object. Each object that is placed on a map gets
a unique id. Even if an object was deleted, no object gets the same
ID. Can not be changed in Tiled. (since Tiled 0.11)
- **id:** Unique ID of the object (defaults to 0, with valid IDs being at
least 1). Each object that is placed on a map gets a unique id. Even if an
object was deleted, no object gets the same ID. Can not be changed in Tiled.
(since Tiled 0.11)
- **name:** The name of the object. An arbitrary string. (defaults to "")
- **type:** The type of the object. An arbitrary string. (defaults to "")
- **x:** The x coordinate of the object in pixels. (defaults to 0)
Expand Down Expand Up @@ -633,9 +637,10 @@ of the object.
<imagelayer>
------------

- **id:** Unique ID of the layer. Each layer that added to a map gets
a unique id. Even if a layer is deleted, no layer ever gets the same
ID. Can not be changed in Tiled. (since Tiled 1.2)
- **id:** Unique ID of the layer (defaults to 0, with valid IDs being at least
1). Each layer that added to a map gets a unique id. Even if a layer is
deleted, no layer ever gets the same ID. Can not be changed in Tiled.
(since Tiled 1.2)
- **name:** The name of the image layer. (defaults to "")
- **offsetx:** Horizontal offset of the image layer in pixels. (defaults to
0) (since 0.15)
Expand All @@ -661,9 +666,10 @@ Can contain at most one: :ref:`tmx-properties`, :ref:`tmx-image`
<group>
-------

- **id:** Unique ID of the layer. Each layer that added to a map gets
a unique id. Even if a layer is deleted, no layer ever gets the same
ID. Can not be changed in Tiled. (since Tiled 1.2)
- **id:** Unique ID of the layer (defaults to 0, with valid IDs being at least
1). Each layer that added to a map gets a unique id. Even if a layer is
deleted, no layer ever gets the same ID. Can not be changed in Tiled.
(since Tiled 1.2)
- **name:** The name of the group layer. (defaults to "")
- **offsetx:** Horizontal offset of the group layer in pixels. (defaults to
0)
Expand Down Expand Up @@ -763,7 +769,12 @@ Example of a template file:
<object name="cactus" gid="31" width="81" height="101"/>
</template>
Can contain at most one: :ref:`tmx-tileset`, :ref:`tmx-object`
Any tileset reference should always come before the object. Embedded tilesets
are not supported.

Can contain at most one: :ref:`tmx-tileset`

Should contain exactly one: :ref:`tmx-object`

--------------

Expand Down
14 changes: 14 additions & 0 deletions docs/scripting-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
"typedoc": "^0.21.7",
"typescript": "^4.4.4"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/bjorn"
},
{
"type": "opencollective",
"url": "https://opencollective.com/tiled"
},
{
"type": "patreon",
"url": "https://patreon.com/bjorn"
}
],
"bugs": {
"url": "https://github.com/mapeditor/tiled/issues"
},
Expand Down
2 changes: 2 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ parts:
# - python-dev
- qttools5-dev-tools
- qtdeclarative5-dev
- qtdeclarative5-private-dev
- qtbase5-private-dev
- zlib1g-dev
- libzstd-dev
stage-packages:
Expand Down
11 changes: 3 additions & 8 deletions src/libtiled/isometricrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ QRect IsometricRenderer::mapBoundingRect() const
{
if (!map()->infinite()) {
const int side = map()->height() + map()->width();
return QRect(0, 0, side * map()->tileWidth() / 2,
return QRect(0, 0,
side * map()->tileWidth() / 2,
side * map()->tileHeight() / 2);
}

Expand All @@ -58,13 +59,7 @@ QRect IsometricRenderer::mapBoundingRect() const
if (mapBounds.size() == QSize(0, 0))
mapBounds.setSize(QSize(1, 1));

const int origin = mapBounds.x() + mapBounds.y();
const int side = mapBounds.width() + mapBounds.height();

return QRect(origin * map()->tileWidth() / 2,
origin * map()->tileHeight() / 2,
side * map()->tileWidth() / 2,
side * map()->tileHeight() / 2);
return boundingRect(mapBounds);
}

QRect IsometricRenderer::boundingRect(const QRect &rect) const
Expand Down
1 change: 1 addition & 0 deletions src/tiled/documentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ DocumentManager::DocumentManager(QObject *parent)

mTabBar->setExpanding(false);
mTabBar->setDocumentMode(true);
mTabBar->setUsesScrollButtons(true); // defaults to false on macOS
mTabBar->setTabsClosable(true);
mTabBar->setMovable(true);
mTabBar->setContextMenuPolicy(Qt::CustomContextMenu);
Expand Down
8 changes: 4 additions & 4 deletions src/tiled/editablelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ EditableLayer::EditableLayer(std::unique_ptr<Layer> layer, QObject *parent)
: EditableObject(nullptr, layer.get(), parent)
{
mDetachedLayer = std::move(layer);
EditableManager::instance().mEditableLayers.insert(this->layer(), this);
EditableManager::instance().mEditables.insert(this->layer(), this);
}

EditableLayer::EditableLayer(EditableAsset *asset, Layer *layer, QObject *parent)
Expand All @@ -42,7 +42,7 @@ EditableLayer::EditableLayer(EditableAsset *asset, Layer *layer, QObject *parent

EditableLayer::~EditableLayer()
{
EditableManager::instance().mEditableLayers.remove(layer());
EditableManager::instance().remove(this);
}

EditableMap *EditableLayer::map() const
Expand Down Expand Up @@ -71,13 +71,13 @@ void EditableLayer::detach()
{
Q_ASSERT(asset());

EditableManager::instance().mEditableLayers.remove(layer());
EditableManager::instance().remove(this);
setAsset(nullptr);

mDetachedLayer.reset(layer()->clone());
mDetachedLayer->resetIds();
setObject(mDetachedLayer.get());
EditableManager::instance().mEditableLayers.insert(layer(), this);
EditableManager::instance().mEditables.insert(layer(), this);
}

/**
Expand Down
Loading

0 comments on commit 7ea7bd8

Please sign in to comment.