- Gerber Editor: Region Tool will add regions only in '0' aperture
This commit is contained in:
@@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
18.04.2019
|
18.04.2019
|
||||||
- Gerber Editor: added custom mouse cursors for each mode in Add Track Tool
|
- Gerber Editor: added custom mouse cursors for each mode in Add Track Tool
|
||||||
- Gerber Editor: Poligonize Tool will first fuse polygons that touch each other and at a second try will create a polygon. The polygon will be automatically moved to Aperture '0' (regions).
|
- Gerber Editor: Poligonize Tool will first fuse polygons that touch each other and at a second try will create a polygon. The polygon will be automatically moved to Aperture '0' (regions).
|
||||||
|
- Gerber Editor: Region Tool will add regions only in '0' aperture
|
||||||
|
|
||||||
17.04.2019
|
17.04.2019
|
||||||
|
|
||||||
|
|||||||
@@ -620,6 +620,12 @@ class FCRegion(FCShapeTool):
|
|||||||
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
|
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
|
||||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||||
|
|
||||||
|
# regions are added always in the '0' aperture
|
||||||
|
if '0' not in self.draw_app.storage_dict:
|
||||||
|
self.draw_app.on_aperture_add(apid='0')
|
||||||
|
else:
|
||||||
|
self.draw_app.last_aperture_selected = '0'
|
||||||
|
|
||||||
self.mode = 1
|
self.mode = 1
|
||||||
self.draw_app.app.inform.emit(_('Corner Mode 1: 45 degrees ...'))
|
self.draw_app.app.inform.emit(_('Corner Mode 1: 45 degrees ...'))
|
||||||
|
|
||||||
@@ -658,56 +664,57 @@ class FCRegion(FCShapeTool):
|
|||||||
mx = abs(round((x - old_x) / self.gridx_size))
|
mx = abs(round((x - old_x) / self.gridx_size))
|
||||||
my = abs(round((y - old_y) / self.gridy_size))
|
my = abs(round((y - old_y) / self.gridy_size))
|
||||||
|
|
||||||
if self.draw_app.app.ui.grid_snap_btn.isChecked():
|
if mx and my:
|
||||||
if self.mode != 5:
|
if self.draw_app.app.ui.grid_snap_btn.isChecked():
|
||||||
if self.mode == 1:
|
if self.mode != 5:
|
||||||
if x > old_x:
|
if self.mode == 1:
|
||||||
if mx > my:
|
if x > old_x:
|
||||||
self.inter_point = (old_x + self.gridx_size * (mx - my), old_y)
|
if mx > my:
|
||||||
if mx < my:
|
self.inter_point = (old_x + self.gridx_size * (mx - my), old_y)
|
||||||
if y < old_y:
|
if mx < my:
|
||||||
self.inter_point = (old_x, old_y - self.gridy_size * (my - mx))
|
if y < old_y:
|
||||||
else:
|
self.inter_point = (old_x, old_y - self.gridy_size * (my - mx))
|
||||||
self.inter_point = (old_x, old_y - self.gridy_size * (mx - my))
|
else:
|
||||||
if x < old_x:
|
self.inter_point = (old_x, old_y - self.gridy_size * (mx - my))
|
||||||
if mx > my:
|
if x < old_x:
|
||||||
self.inter_point = (old_x - self.gridx_size * (mx - my), old_y)
|
if mx > my:
|
||||||
if mx < my:
|
self.inter_point = (old_x - self.gridx_size * (mx - my), old_y)
|
||||||
if y < old_y:
|
if mx < my:
|
||||||
self.inter_point = (old_x, old_y - self.gridy_size * (my - mx))
|
if y < old_y:
|
||||||
else:
|
self.inter_point = (old_x, old_y - self.gridy_size * (my - mx))
|
||||||
self.inter_point = (old_x, old_y - self.gridy_size * (mx - my))
|
else:
|
||||||
elif self.mode == 2:
|
self.inter_point = (old_x, old_y - self.gridy_size * (mx - my))
|
||||||
if x > old_x:
|
elif self.mode == 2:
|
||||||
if mx > my:
|
if x > old_x:
|
||||||
self.inter_point = (old_x + self.gridx_size * my, y)
|
if mx > my:
|
||||||
if mx < my:
|
self.inter_point = (old_x + self.gridx_size * my, y)
|
||||||
if y < old_y:
|
if mx < my:
|
||||||
self.inter_point = (x, old_y - self.gridy_size * mx)
|
if y < old_y:
|
||||||
else:
|
self.inter_point = (x, old_y - self.gridy_size * mx)
|
||||||
self.inter_point = (x, old_y + self.gridy_size * mx)
|
else:
|
||||||
if x < old_x:
|
self.inter_point = (x, old_y + self.gridy_size * mx)
|
||||||
if mx > my:
|
if x < old_x:
|
||||||
self.inter_point = (old_x - self.gridx_size * my, y)
|
if mx > my:
|
||||||
if mx < my:
|
self.inter_point = (old_x - self.gridx_size * my, y)
|
||||||
if y < old_y:
|
if mx < my:
|
||||||
self.inter_point = (x, old_y - self.gridy_size * mx)
|
if y < old_y:
|
||||||
else:
|
self.inter_point = (x, old_y - self.gridy_size * mx)
|
||||||
self.inter_point = (x, old_y + self.gridy_size * mx)
|
else:
|
||||||
elif self.mode == 3:
|
self.inter_point = (x, old_y + self.gridy_size * mx)
|
||||||
self.inter_point = (x, old_y)
|
elif self.mode == 3:
|
||||||
elif self.mode == 4:
|
self.inter_point = (x, old_y)
|
||||||
self.inter_point = (old_x, y)
|
elif self.mode == 4:
|
||||||
|
self.inter_point = (old_x, y)
|
||||||
|
|
||||||
if self.inter_point is not None:
|
if self.inter_point is not None:
|
||||||
self.temp_points.append(self.inter_point)
|
self.temp_points.append(self.inter_point)
|
||||||
else:
|
else:
|
||||||
self.inter_point = data
|
self.inter_point = data
|
||||||
|
|
||||||
self.temp_points.append(data)
|
else:
|
||||||
else:
|
self.inter_point = data
|
||||||
self.inter_point = data
|
|
||||||
self.temp_points.append(data)
|
self.temp_points.append(data)
|
||||||
|
|
||||||
if len(self.temp_points) > 1:
|
if len(self.temp_points) > 1:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user