Skip to content

Fix selection tool performance in tilemap layers in 'Tiles' mode#5760

Merged
dacap merged 1 commit into
aseprite:mainfrom
Gasparoken:fix-tile-point
Apr 21, 2026
Merged

Fix selection tool performance in tilemap layers in 'Tiles' mode#5760
dacap merged 1 commit into
aseprite:mainfrom
Gasparoken:fix-tile-point

Conversation

@Gasparoken

@Gasparoken Gasparoken commented Apr 20, 2026

Copy link
Copy Markdown
Member

This fix has no associated issue; the improvement was discovered following the finding that @ckaiser mentioned during a review:
Large tiles (e.g. 128x128) caused a noticeable delay when releasing the mouse button during a selection action in tilemap mode 'Tiles'. The issue becomes more noticeable with larger tile sizes.
How to reproduce the original issue:

  • Active tilemap layer with large tile size (e.g., 128x128)
  • TilemapMode::Tiles
  • Rectangular Marquee Tool
  • Make a selection.

@aseprite-bot aseprite-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

bool isPixel() override { return true; }
bool isTile() override { return true; }

void preparePointShape(ToolLoop* loop) override

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'loop' is unused [misc-unused-parameters]

Suggested change
void preparePointShape(ToolLoop* loop) override
void preparePointShape(ToolLoop* /*loop*/) override

@dacap

dacap commented Apr 20, 2026

Copy link
Copy Markdown
Member

I guess this fixes a performance issue as I noticed a heavy CPU usage without this patch, but I'm not sure if this is related to that (as the PR and the commit don't mention the performance issue).

@dacap dacap assigned Gasparoken and unassigned dacap Apr 21, 2026
@dacap

dacap commented Apr 21, 2026

Copy link
Copy Markdown
Member

I've assigned back this PR @Gasparoken so you can improve a little the commit message just to know what this patch does at the user level (not at the internal level)

Before this fix, large tiles (e.g. 128x128) caused a noticeable
delay when releasing the mouse button during a selection action
in tilemap mode 'Tiles'.
The issue becomes more noticeable with larger tile sizes.
@Gasparoken Gasparoken changed the title Fix avoid unnecessary transform point calculation during TilePointShape Fix selection tool performance in tilemap layers in 'Tiles' mode Apr 21, 2026
@Gasparoken Gasparoken assigned dacap and unassigned Gasparoken Apr 21, 2026
@dacap dacap merged commit e053655 into aseprite:main Apr 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants