← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] CW/CCW rotation in GAL

 

This will all be moot when GAL hotkeys can be remapped, since users
that care can swap them over.

In any case, the attached patch can be applied after the correction
above to also swap 'R' and 'Shift-R', so that R is CCW.

Cheers,

John


On Thu, Mar 30, 2017 at 7:32 PM, Clemens Koller <cko@xxxxxxxxx> wrote:
> Hello, Jon!
>
> On 2017-03-30 11:07, John Beard wrote:
>> 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?
>
> I would strongly prefer to use the mathematically positive rotation (CCW) by default.
>
> R -> CCW (Rotate +)    and    Shift-R -> CW (Rotate -)
>
> Simply because it's what the majority of applications use...
>
> Regards,
>
> Clemens
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
From 27e19e9b0d417bde24c33a3911a2748f111a8420 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Thu, 30 Mar 2017 19:49:47 +0800
Subject: [PATCH] Pcbnew GAL: Switch CW/CCW hotkeys to match legacy mode

---
 pcbnew/tools/edit_tool.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp
index 5dab27c24..6ff32b410 100644
--- a/pcbnew/tools/edit_tool.cpp
+++ b/pcbnew/tools/edit_tool.cpp
@@ -111,12 +111,12 @@ TOOL_ACTION PCB_ACTIONS::createArray( "pcbnew.InteractiveEdit.createArray",
         _( "Create Array" ), _( "Create array" ), array_module_xpm, AF_ACTIVATE );
 
 TOOL_ACTION PCB_ACTIONS::rotateCw( "pcbnew.InteractiveEdit.rotateCw",
-        AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROTATE_ITEM ),
+        AS_GLOBAL, MD_SHIFT + 'R',
         _( "Rotate Clockwise" ), _( "Rotates selected item(s) clockwise" ),
         rotate_cw_xpm, AF_NONE, (void*) -1 );
 
 TOOL_ACTION PCB_ACTIONS::rotateCcw( "pcbnew.InteractiveEdit.rotateCcw",
-        AS_GLOBAL, MD_SHIFT + 'R',
+        AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROTATE_ITEM ),
         _( "Rotate Counter-clockwise" ), _( "Rotates selected item(s) counter-clockwise" ),
         rotate_ccw_xpm, AF_NONE, (void*) 1 );
 
@@ -195,8 +195,8 @@ bool EDIT_TOOL::Init()
     // Add context menu entries that are displayed when selection tool is active
     CONDITIONAL_MENU& menu = m_selectionTool->GetToolMenu().GetMenu();
     menu.AddItem( PCB_ACTIONS::editActivate, SELECTION_CONDITIONS::NotEmpty );
-    menu.AddItem( PCB_ACTIONS::rotateCw, SELECTION_CONDITIONS::NotEmpty );
     menu.AddItem( PCB_ACTIONS::rotateCcw, SELECTION_CONDITIONS::NotEmpty );
+    menu.AddItem( PCB_ACTIONS::rotateCw, SELECTION_CONDITIONS::NotEmpty );
     menu.AddItem( PCB_ACTIONS::flip, SELECTION_CONDITIONS::NotEmpty );
     menu.AddItem( PCB_ACTIONS::remove, SELECTION_CONDITIONS::NotEmpty );
     menu.AddItem( PCB_ACTIONS::properties, SELECTION_CONDITIONS::Count( 1 )
-- 
2.12.0


Follow ups

References