Skip to content

Commit

Permalink
Add minimum drag distance before resizing new tile
Browse files Browse the repository at this point in the history
Add a minimum drag distance before resizing newly placed tiles to prevent accidental resizing
  • Loading branch information
ExplosBlue committed Jul 24, 2023
1 parent aa40611 commit 1556bbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><img src="https://raw.githubusercontent.com/Arisotura/CoinKiller/master/coinkiller_data/icons/logo.png" width="128" height="128"></p>
<p align="center"><img src="https://raw.githubusercontent.com/Arisotura/CoinKiller/master/resource/ck_icon.png" width="128" height="128"></p>
<h1 align="center">CoinKiller</h1>
<p align="center">
A level editor for NSMB2. Uses Qt6 and is coded in C++.
Expand Down
5 changes: 5 additions & 0 deletions objectseditionmode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ void ObjectsEditonMode::mouseDrag(int x, int y, Qt::KeyboardModifiers modifieres
lx = x;
ly = y;

if (qAbs((dx-lx) + (dy-ly)) < 20)
{
return;
}

int xpos = typeRound(dx, newObject->getType());
int ypos = typeRound(dy, newObject->getType());

Expand Down

0 comments on commit 1556bbf

Please sign in to comment.