Skip to content

Commit

Permalink
Fix alignment issue when pasting
Browse files Browse the repository at this point in the history
  • Loading branch information
ExplosBlue committed Sep 12, 2023
1 parent 89bd175 commit 8c35f3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions leveleditor/editmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,8 @@ void EditManager::copy()

if (hasBgDats)
{
minX = typeRound(minX, 0);
minY = typeRound(minY, 0);
minX = typeRound(minX, ObjectType::BGDATOBJECT);
minY = typeRound(minY, ObjectType::BGDATOBJECT);
}

QList<Path*> paths;
Expand Down
3 changes: 1 addition & 2 deletions unitsconvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

#include "unitsconvert.h"
#include "objects.h"

int sign(int nbr)
{
Expand All @@ -30,7 +29,7 @@ int toNext10(int nbr) { return ((nbr + sign(nbr)*5) / 10 * 10); }
int toNext20(int nbr) { return ((nbr + sign(nbr)*10) / 20 * 20); }
int toNext16Compatible(int nbr) { return to20(to16(nbr)); }

int typeRound(int nbr, int type)
int typeRound(int nbr, ObjectType type)
{
if (type == ObjectType::BGDATOBJECT)
return toNext20(nbr-10);
Expand Down
4 changes: 3 additions & 1 deletion unitsconvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
#ifndef UNITSCONVERT_H
#define UNITSCONVERT_H

#include "objects.h"

int sign(int nbr);
int to20(int nbr);
int to16(int nbr);
int toNext10(int nbr);
int toNext20(int nbr);
int toNext16Compatible(int nbr);
int typeRound(int nbr, int type);
int typeRound(int nbr, ObjectType type);

#endif // UNITSCONVERT_H

0 comments on commit 8c35f3d

Please sign in to comment.