← Back to team overview

kicad-developers team mailing list archive

[PATCH] CW/CCW rotation in GAL

 

Hi,

When CW/CCW rotation was added in GAL (7045ed92f), the tool actions
didn't correct for the internal represention of angles, so CW/CCW were
reversed. This patch fixes that. I failed to notice the comment "//
TODO rotate CCW" was wrong. On the other hand, it seems only one
person actually noticed since Feb 4th :-p, including myself.

Now, eeschema standard rotate (R) is CW, but legacy Pcbnew "Rotate+"
(also R) is CCW.

I have not changed the hotkey assignment for the GAL actions, so it
now matches eeschema, not legacy mode. I think that CW-default is the
better default?

Cheers,

John
From 2a04337fd517d00c311b1cca4fd28cede1365330 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Thu, 30 Mar 2017 16:48:00 +0800
Subject: [PATCH] Pcbnew: correct CW/CCW rotation.

These were backwards since internal angles are CCW due to the inverted Y
axis.

The hotkeys have NOT changed. This means 'R' is now clockwise and
'Shift+R' is anti-clockwise. This is the same as EEschema, but not the
same as Legacy mode.
---
 pcbnew/tools/edit_tool.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp
index 00d9e99a3..5dab27c24 100644
--- a/pcbnew/tools/edit_tool.cpp
+++ b/pcbnew/tools/edit_tool.cpp
@@ -113,12 +113,12 @@ TOOL_ACTION PCB_ACTIONS::createArray( "pcbnew.InteractiveEdit.createArray",
 TOOL_ACTION PCB_ACTIONS::rotateCw( "pcbnew.InteractiveEdit.rotateCw",
         AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROTATE_ITEM ),
         _( "Rotate Clockwise" ), _( "Rotates selected item(s) clockwise" ),
-        rotate_cw_xpm, AF_NONE, (void*) 1 );
+        rotate_cw_xpm, AF_NONE, (void*) -1 );
 
 TOOL_ACTION PCB_ACTIONS::rotateCcw( "pcbnew.InteractiveEdit.rotateCcw",
         AS_GLOBAL, MD_SHIFT + 'R',
         _( "Rotate Counter-clockwise" ), _( "Rotates selected item(s) counter-clockwise" ),
-        rotate_ccw_xpm, AF_NONE, (void*) -1 );
+        rotate_ccw_xpm, AF_NONE, (void*) 1 );
 
 TOOL_ACTION PCB_ACTIONS::flip( "pcbnew.InteractiveEdit.flip",
         AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_FLIP_ITEM ),
-- 
2.12.0


Follow ups