Use EXACT for checking theta

This commit is contained in:
Koen Schmeets 2020-11-28 13:50:38 +01:00 committed by phkahler
parent 6b91ab5778
commit b316a8863b

View File

@ -260,8 +260,7 @@ void GraphicsWindow::PasteClipboard(Vector trans, double theta, double scale) {
case Constraint::Type::HORIZONTAL: case Constraint::Type::HORIZONTAL:
case Constraint::Type::VERTICAL: case Constraint::Type::VERTICAL:
// When rotating 90 or 270 degrees, swap the vertical / horizontal constaints // When rotating 90 or 270 degrees, swap the vertical / horizontal constaints
dbp("Remainder: %f", fmod(theta + (PI / 2), PI)); if (EXACT(fmod(theta + (PI/2), PI) == 0)) {
if (fmod(theta + (PI/2), PI) == 0) {
if(c.type == Constraint::Type::HORIZONTAL) { if(c.type == Constraint::Type::HORIZONTAL) {
c.type = Constraint::Type::VERTICAL; c.type = Constraint::Type::VERTICAL;
} else { } else {