mapeditor / mapeditor/tiled

Scripting documentation: Qt.rect's additional properties, TileMap.resize()

Open
#3,479 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

(Whoops, did not mean to mark this one as a bug!)
Two documentation things, and maybe a feature request:

  1. The documentation for TileMap.resize() says

    This operation can currently only be applied to maps loaded from a file.

    However, it works just fine on open maps that are unsaved. I suspect this is left over from when maps always had to be saved to a file to be opened as documents in Tiled. I haven't thoroughly tested it so I don't know what wording to offer. Does it work for mapFormat.read()? If not, then perhaps appropriate wording would be "[...] maps open in Tiled as documents." If it does work for maps opened from file but not open as documents, then the wording could be "[...] maps open in Tiled as documents, or loaded from a file."

  2. The documentation for Qt.rect only lists its x, y, width, and height properties, but it actually also has left, right, top, bottom properties. These appear to be read-only - trying to set them does not update them or change the rect's other properties.
    I think these should at least be documented as read-only, as they're very convenient! Better yet, if possible, they should be made settable, updating the rectangle's other properties as appropriate. QRect already has setter functions for them, e.g. https://doc.qt.io/qt-5/qrect.html#setBottom

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TileMap.resize() and Qt.rect documentation entries linked in the issue, then verify resize() behavior for unsaved maps and mapFormat.read() maps. Check which Qt.rect properties are exposed and whether they are read-only. Done means the documentation accurately describes TileMap.resize() limitations and lists the additional rect properties with their mutability.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.