Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI/psmap: fix simple point graphic recalculate position #3164

Merged

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Sep 18, 2023

Describe the bug
Changing the position of the simple point graphic prints an error message.

To Reproduce
Steps to reproduce the behavior:

  1. Launch g.gui.psmap
  2. Add one simple point graphic
  3. Activate Pointer tool from the main toolbar
  4. Try to interactively change simple point graphic position
  5. See error
Traceback (most recent call last):
  File "/usr/lib64/grass84/gui/wxpython/psmap/frame.py", line 1605, in MouseActions
    self.OnLeftUp(event)
  File "/usr/lib64/grass84/gui/wxpython/psmap/frame.py", line 1849, in OnLeftUp
    self.RecalculatePosition(ids=[self.dragId])
  File "/usr/lib64/grass84/gui/wxpython/psmap/frame.py", line 2128, in RecalculatePosition
    rect.Offset(
TypeError: Rect.Offset(): arguments did not match any overloaded call:
  overload 1: argument 'dx' has unexpected type 'float'
  overload 2: 'dx' is not a valid keyword argument

Expected behavior
Changing the position of the simple point graphic should not prints an error message.

System description:

  • Operating System: GNU/Linux
  • GRASS GIS version: all
GRASS nc_basic_spm_grass7/PERMANENT:~ > python3 -c "import sys, wx; print(sys.version); print(wx.version())"
3.10.13 (main, Sep 16 2023, 22:24:59) [GCC 12.3.1 20230526]
4.2.0 gtk3 (phoenix) wxWidgets 3.2.2.1

Additional context
Rectangle widget with integer coordinates ,Offset() method dx,dy parameters require integer argument type.

Method doc:
https://docs.wxpython.org/wx.Rect.html#wx.Rect.Offset

Rectangle widget with integer coordinates Offset() method dx, dy
parameters require integer argument type.
@tmszi tmszi added bug Something isn't working GUI wxGUI related backport to 8.3 labels Sep 18, 2023
@tmszi tmszi added this to the 8.3.1 milestone Sep 18, 2023
@tmszi tmszi merged commit 6ffd18f into OSGeo:main Sep 19, 2023
tmszi added a commit to tmszi/grass that referenced this pull request Sep 19, 2023
Rectangle widget with integer coordinates Offset() method dx, dy
parameters require integer argument type.
tmszi added a commit to tmszi/grass that referenced this pull request Sep 19, 2023
Rectangle widget with integer coordinates Offset() method dx, dy
parameters require integer argument type.
@tmszi tmszi deleted the wxgui-psmap-fix-simple-point-graphic-rotation branch September 19, 2023 03:48
@a-detiste
Copy link
Contributor

a-detiste commented Sep 21, 2023

In python3, the operator for integer division is //

landam pushed a commit to landam/grass that referenced this pull request Oct 25, 2023
Rectangle widget with integer coordinates Offset() method dx, dy
parameters require integer argument type.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Rectangle widget with integer coordinates Offset() method dx, dy
parameters require integer argument type.
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Jan 9, 2024
Rectangle widget with integer coordinates Offset() method dx, dy
parameters require integer argument type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI wxGUI related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants