Compare commits

...

7 Commits

Author SHA1 Message Date
grossmj
705cbf8bb9 Release v2.2.39 2023-05-08 19:17:02 +08:00
Jeremy Grossmann
ab6e0ce496 Merge pull request #3461 from GNS3/fix/3441
Fix nodes are not snapped to the grid at the moment of creation
2023-05-08 17:13:20 +08:00
grossmj
8042c9eb6f Fix tests 2023-05-08 17:08:10 +08:00
grossmj
ad3c8a09db Fix nodes are not snapped to the grid at the moment of creation 2023-04-23 05:18:02 -10:00
grossmj
ea4a7f201e Upgrade sentry-sdk 2023-03-23 21:41:50 -10:00
grossmj
28c82b8718 Upgrade distro and aiohttp dependencies 2023-03-01 18:03:28 +10:00
grossmj
6a4dd59e81 Development on 2.2.39.dev1 2023-02-28 17:09:39 +10:00
7 changed files with 17 additions and 7 deletions

View File

@@ -1,5 +1,10 @@
# Change Log
## 2.2.39 08/05/2023
* Fix nodes are not snapped to the grid at the moment of creation
* Upgrade distro and aiohttp dependencies
## 2.2.38 28/02/2023
* Add long description content type in setup.py

View File

@@ -51,7 +51,7 @@ class CrashReport:
Report crash to a third party service
"""
DSN = "https://e1c08ac6a2f44c1f96055affc49b2e72@o19455.ingest.sentry.io/38506"
DSN = "https://de4e2c3e542f47149bf89dffb48491ae@o19455.ingest.sentry.io/38506"
_instance = None
def __init__(self):

View File

@@ -213,7 +213,7 @@ class DrawingItem:
def itemChange(self, change, value):
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self.isActive() and self._main_window.uiSnapToGridAction.isChecked():
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self._main_window.uiSnapToGridAction.isChecked():
grid_size = self._graphics_view.drawingGridSize()
mid_x = self.boundingRect().width() / 2
value.setX((grid_size * round((value.x() + mid_x) / grid_size)) - mid_x)

View File

@@ -108,6 +108,9 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
if node.initialized():
self.createdSlot(node.id())
if self._main_window.uiSnapToGridAction.isChecked():
self.setPos(QtCore.QPointF(self._node.x() + 0.1, self._node.y()))
def updateNode(self):
"""
Sync change to the node
@@ -466,7 +469,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
:param value: value of the change
"""
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self.isActive() and self._main_window.uiSnapToGridAction.isChecked():
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self._main_window.uiSnapToGridAction.isChecked():
grid_size = self._main_window.uiGraphicsView.nodeGridSize()
mid_x = self.boundingRect().width() / 2
value.setX((grid_size * round((value.x() + mid_x) / grid_size)) - mid_x)

View File

@@ -23,8 +23,8 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
__version__ = "2.2.38"
__version_info__ = (2, 2, 38, 0)
__version__ = "2.2.39"
__version_info__ = (2, 2, 39, 0)
if "dev" in __version__:
try:

View File

@@ -1,7 +1,7 @@
jsonschema>=4.17.3,<4.18; python_version >= '3.7'
jsonschema==3.2.0; python_version < '3.7' # v3.2.0 is the last version to support Python 3.6
sentry-sdk==1.12.1,<1.13
sentry-sdk==1.17.0,<1.18
psutil==5.9.4
distro>=1.7.0
distro>=1.8.0
setuptools>=60.8.1; python_version >= '3.7'
setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6

View File

@@ -61,6 +61,7 @@ def test_toSvg_negative_y(project, controller):
def test_fromSvg(project, controller):
line = LineItem(project=project)
line._main_window.uiSnapToGridAction.isChecked = lambda: False
line.setPos(50, 84)
line.fromSvg('<svg height="150" width="250"><line x1="0" y1="0" x2="250" y2="150" stroke-width="5" stroke="#0000ff" stroke-dasharray="5, 25, 25" /></svg>')
assert line.line().x1() == 0
@@ -75,6 +76,7 @@ def test_fromSvg(project, controller):
def test_fromSvg_top_direction(project, controller):
line = LineItem(project=project)
line._main_window.uiSnapToGridAction.isChecked = lambda: False
line.setPos(50, 84)
line.fromSvg('<svg height="150" width="250"><line x1="0" y1="150" x2="250" y2="0" stroke-width="5" stroke="#0000ff" stroke-dasharray="5, 25, 25" /></svg>')
assert line.line().x1() == 0