summaryrefslogtreecommitdiff
path: root/sci-libs/avogadrolibs/files/avogadrolibs-1.95.1-usability_backport.patch
blob: 07a32023600e1d651d82f45d371d66ac289951b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 56c67fff7dd7ec84b2f2b5c2e5beaec13981e408 Mon Sep 17 00:00:00 2001
From: Aritz Erkiaga <aerkiaga3@gmail.com>
Date: Sat, 3 Sep 2022 16:54:55 +0200
Subject: [PATCH 1/3] Fix erratic editing behavior

Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
---
 avogadro/qtgui/rwmolecule_undo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avogadro/qtgui/rwmolecule_undo.h b/avogadro/qtgui/rwmolecule_undo.h
index de5bdd33..20768066 100644
--- a/avogadro/qtgui/rwmolecule_undo.h
+++ b/avogadro/qtgui/rwmolecule_undo.h
@@ -89,7 +89,7 @@ public:
   {
     assert(m_molecule.atomCount() == m_atomId);
     if (m_usingPositions)
-      m_molecule.addAtom(m_atomicNumber, Vector3::Zero(), m_atomId);
+      m_molecule.addAtom(m_atomicNumber, Vector3::Zero(), m_atomUid);
     else
       m_molecule.addAtom(m_atomicNumber, m_atomUid);
     m_molecule.layer().addAtom(m_layer, m_atomId);
-- 
2.34.1


From 5159ea1a9629ad82130670767cc25c5065f9627c Mon Sep 17 00:00:00 2001
From: Aritz Erkiaga <aerkiaga3@gmail.com>
Date: Sat, 3 Sep 2022 16:55:26 +0200
Subject: [PATCH 2/3] Fix Manipulator Tool not working at all

Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
---
 avogadro/qtplugins/manipulator/manipulator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avogadro/qtplugins/manipulator/manipulator.cpp b/avogadro/qtplugins/manipulator/manipulator.cpp
index 19dc51ac..29559dd0 100644
--- a/avogadro/qtplugins/manipulator/manipulator.cpp
+++ b/avogadro/qtplugins/manipulator/manipulator.cpp
@@ -129,7 +129,7 @@ QUndoCommand* Manipulator::mouseMoveEvent(QMouseEvent* e)
   Vector2f windowPos(e->localPos().x(), e->localPos().y());
 
   if (mol->isSelectionEmpty() && m_object.type == Rendering::AtomType &&
-      m_object.molecule == mol) {
+      m_object.molecule == &m_molecule->molecule()) {
     // translate single atom position
     RWAtom atom = m_molecule->atom(m_object.index);
     Vector3f oldPos(atom.position3d().cast<float>());
-- 
2.34.1


From f38bfbc88f0722a66ab298ff26073874b5f73634 Mon Sep 17 00:00:00 2001
From: Aritz Erkiaga <aerkiaga3@gmail.com>
Date: Sat, 3 Sep 2022 16:55:59 +0200
Subject: [PATCH 3/3] Fix Bond Centric Tool not working at all

Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
---
 avogadro/qtplugins/bondcentrictool/bondcentrictool.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/avogadro/qtplugins/bondcentrictool/bondcentrictool.cpp b/avogadro/qtplugins/bondcentrictool/bondcentrictool.cpp
index 79112899..3a853057 100644
--- a/avogadro/qtplugins/bondcentrictool/bondcentrictool.cpp
+++ b/avogadro/qtplugins/bondcentrictool/bondcentrictool.cpp
@@ -342,8 +342,7 @@ QUndoCommand* BondCentricTool::mousePressEvent(QMouseEvent* e)
   Rendering::Identifier ident = m_renderer->hit(e->pos().x(), e->pos().y());
 
   // If no hits, return. Also ensure that the hit molecule is the one we expect.
-  const Core::Molecule* mol = &m_molecule->molecule();
-  if (!ident.isValid() || ident.molecule != mol)
+  if (!ident.isValid() || ident.molecule != &m_molecule->molecule())
     return nullptr;
 
   // If the hit is a left click on a bond, make it the selected bond and map
-- 
2.34.1