devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Update RectTrans to operate on rectangle range like normal

Open ephphatha opened this issue 3 years ago • 0 comments

Using <= instead of < made this function behave differently to other loops over a Rectangle (it was correct when it operated on two points). Added a constructor for Rectangle taking two points to allow expressing the logic in both cases with natural behaviour each time.

This does mean there are now two constructors that could match Rectangle { { int, int }, { int, int } } so all uses of the initialiser list had to be updated to use an explicit Size constructor call or directly use an existing/new Size variable.

ephphatha avatar Jun 15 '22 13:06 ephphatha