Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Arohan Ajit authored and Arohan Ajit committed Jan 24, 2025
1 parent 237db3d commit 2eda914
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions gui/wxpython/vdigit/wxdigit.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,14 @@
Vedit_select_by_query,
Vedit_snap_line,
Vedit_split_lines,
QUERY_UNKNOWN,
QUERY_LENGTH,
QUERY_DANGLE,
)
from grass.pydispatch.signal import Signal
from vdigit.wxdisplay import DisplayDriver, GetLastError

# Define missing constants
QUERY_UNKNOWN = 0
QUERY_LENGTH = 1
QUERY_DANGLE = 2

none = None # Python's None for C compatibility
ret = 0 # Initialize return value
line = Vect_new_line_struct() # Create new line structure
changeset = [] # Initialize changeset list
new_bboxs = [] # Initialize new bboxes list


class VDigitError:
Expand Down Expand Up @@ -1020,7 +1014,7 @@ def MoveSelectedLines(self, move):

if nlines > 0 and self._settings["breakLines"]:
for i in range(1, nlines):
self._breakLineAtIntersection(nlines + i, None, changeset)
self._breakLineAtIntersection(nlines + i, None)

if nlines > 0:
self._addChangeset()
Expand Down Expand Up @@ -1220,6 +1214,7 @@ def EditLine(self, line, coords):
self.poMapInfo, line, ltype, self.poPoints, self.poCats
)
if newline > 0 and self.emit_signals:
new_bboxs = [self._getBbox(newline)]
new_areas_cats = [self._getLineAreasCategories(newline)]

if newline > 0 and self._settings["breakLines"]:
Expand Down Expand Up @@ -1620,7 +1615,7 @@ def GetLineLength(self, line):
ltype = Vect_read_line(self.poMapInfo, self.poPoints, None, line)
if ltype < 0:
self._error.ReadLine(line)
return ret
return -1

length = -1
if ltype & GV_LINES: # lines & boundaries
Expand All @@ -1641,8 +1636,8 @@ def GetAreaSize(self, centroid):

ltype = Vect_read_line(self.poMapInfo, None, None, centroid)
if ltype < 0:
self._error.ReadLine(line)
return ret
self._error.ReadLine(centroid)
return -1

if ltype != GV_CENTROID:
return -1
Expand Down Expand Up @@ -1670,8 +1665,8 @@ def GetAreaPerimeter(self, centroid):

ltype = Vect_read_line(self.poMapInfo, None, None, centroid)
if ltype < 0:
self._error.ReadLine(line)
return ret
self._error.ReadLine(centroid)
return -1

if ltype != GV_CENTROID:
return -1
Expand Down

0 comments on commit 2eda914

Please sign in to comment.