- removed some VisPy patches that now are incorporated in the v 0.9 of VisPy; bumped the VisPy requirement to 0.9.0

This commit is contained in:
Marius Stanciu
2021-10-03 03:01:22 +03:00
committed by Marius
parent 594e91f17b
commit 337d4af249
4 changed files with 40 additions and 39 deletions

View File

@@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta
- updated the language strings to the latest version - updated the language strings to the latest version
- some changes in the Objects UI - some changes in the Objects UI
- removed some VisPy patches that now are incorporated in the v 0.9 of VisPy; bumped the VisPy requirement to 0.9.0
2.10.2021 2.10.2021

View File

@@ -138,9 +138,9 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
# self.v_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 0.8), vertical=True, # self.v_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 0.8), vertical=True,
# parent=self.view.scene) # parent=self.view.scene)
self.v_line = InfiniteLine(pos=0, color=axis_color, vertical=True, self.v_line = InfiniteLine(pos=0, color=axis_color, vertical=True, line_width=1.5,
parent=self.view.scene) parent=self.view.scene)
self.h_line = InfiniteLine(pos=0, color=axis_color, vertical=False, self.h_line = InfiniteLine(pos=0, color=axis_color, vertical=False, line_width=1.5,
parent=self.view.scene) parent=self.view.scene)
self.line_parent = None self.line_parent = None

View File

@@ -15,23 +15,23 @@ import numpy as np
def apply_patches(): def apply_patches():
# Patch MarkersVisual to have crossed lines marker # Patch MarkersVisual to have crossed lines marker
cross_lines = """ # cross_lines = """
float cross(vec2 pointcoord, float size) # float cross(vec2 pointcoord, float size)
{ # {
//vbar # //vbar
float r1 = abs(pointcoord.x - 0.5)*size; # float r1 = abs(pointcoord.x - 0.5)*size;
float r2 = abs(pointcoord.y - 0.5)*size - $v_size/2; # float r2 = abs(pointcoord.y - 0.5)*size - $v_size/2;
float vbar = max(r1,r2); # float vbar = max(r1,r2);
//hbar # //hbar
float r3 = abs(pointcoord.y - 0.5)*size; # float r3 = abs(pointcoord.y - 0.5)*size;
float r4 = abs(pointcoord.x - 0.5)*size - $v_size/2; # float r4 = abs(pointcoord.x - 0.5)*size - $v_size/2;
float hbar = max(r3,r4); # float hbar = max(r3,r4);
return min(vbar, hbar); # return min(vbar, hbar);
} # }
""" # """
#
markers._marker_dict['++'] = cross_lines # markers._marker_dict['++'] = cross_lines
markers.marker_types = tuple(sorted(list(markers._marker_dict.copy().keys()))) # markers.marker_types = tuple(sorted(list(markers._marker_dict.copy().keys())))
# # Add clear_data method to LineVisual to have possibility of clearing data # # Add clear_data method to LineVisual to have possibility of clearing data
# def clear_data(self): # def clear_data(self):
@@ -57,25 +57,25 @@ def apply_patches():
Grid._update_clipper = _update_clipper Grid._update_clipper = _update_clipper
# Patch InfiniteLine visual to 1.5px width # Patch InfiniteLine visual to 1.5px width
def _prepare_draw(self, view=None): # def _prepare_draw(self, view=None):
"""This method is called immediately before each draw. # """This method is called immediately before each draw.
The *view* argument indicates which view is about to be drawn. # The *view* argument indicates which view is about to be drawn.
""" # """
#
self.update_gl_state(line_smooth=False) # self.update_gl_state(line_smooth=False)
px_scale = self.transforms.pixel_scale # px_scale = self.transforms.pixel_scale
width = px_scale * 1.5 # width = px_scale * 1.5
self.update_gl_state(line_width=max(width, 1.0)) # self.update_gl_state(line_width=max(width, 1.0))
#
if self._changed['pos']: # if self._changed['pos']:
self.pos_buf.set_data(self._pos) # self.pos_buf.set_data(self._pos)
self._changed['pos'] = False # self._changed['pos'] = False
#
if self._changed['color']: # if self._changed['color']:
self._program.vert['color'] = self._color # self._program.vert['color'] = self._color
self._changed['color'] = False # self._changed['color'] = False
#
InfiniteLineVisual._prepare_draw = _prepare_draw # InfiniteLineVisual._prepare_draw = _prepare_draw
# Patch AxisVisual to have less axis labels # Patch AxisVisual to have less axis labels
def _get_tick_frac_labels(self): def _get_tick_frac_labels(self):

View File

@@ -29,7 +29,7 @@ pyserial>=3.4
pikepdf>=2.0 pikepdf>=2.0
pywin32>2.0 pywin32>2.0
pyqt6>=6.1.0 pyqt6>=6.1.0
vispy>=0.8.1 vispy>=0.9.0
rasterio rasterio
foronoi>=1.0.3 foronoi>=1.0.3
networkx networkx