Commit graph

8 commits

Author SHA1 Message Date
Marcel Hellwig
c9f8f40a6c replace deprecated qt api with recommended functions 2021-02-18 08:13:39 +01:00
Marcus Rowe
d937289a1c Add Tile Viewer Window 2017-10-29 21:22:42 +10:00
Marcus Rowe
75bfb8ba7f Correctly draw selected cell border in ImageGridWidget
This commit also fixes a glitch in Qt5 where the outline of some
selected TilemapViewer cells were not rendered correctly if the zoom was
set to a prime number.
2017-06-06 17:44:32 +10:00
Marcus Rowe
9965d45a4e Use cosmetic QPen in ImageGridWidget
This is the proper method of drawing lines with a constant width that is
independent of the QPainter transformation.
2017-06-06 17:43:27 +10:00
Marcus Rowe
0351da7b31 Fix grid pen width in ImageGridWidget for Qt5
Qt5's default pen width is 1.0 and therefore the grid line thickness
increases when zooming in.

This commit changes the grid pen width to the inverse of zoom so it is
rendered same thickness independent of the zoom setting.
2017-03-18 18:21:35 +10:00
Marcus Rowe
6faffa76f6 Fix drawSelectedCell for hi-dpi displays
Optiroc has mentioned that the selected tile box's position and size is
multiplied by two on his Mac. This is caused by either
`painter->combinedTransform()` returning the wrong value for hi-dpi
displays or `painter->resetTransform()` not working as expected on
hi-dpi displays.

The new code does not call `painter->resetTransform()` but instead sets
the pen width and cell adjust to the inverse of the zoom, which cancels
out the transform and should render as one pixel to the user.
2017-03-17 23:30:46 +10:00
Marcus Rowe
9b146b4235 Add grid cell selection to ImageGridWidget 2017-03-16 20:41:47 +10:00
Marcus Rowe
f13c9a894f Add optional grid to Tilemap Viewer 2017-03-16 20:16:52 +10:00