- removed patch to fix scaling on HIDPI displays since now the fix is implemented in VisPy v0.8.1

- modified a patch for VisPy Infinite Line Visual that set the line width, in order to make it compliant with newer versions of OpenGL
This commit is contained in:
Marius Stanciu
2021-08-30 02:27:06 +03:00
committed by Marius
parent 6f87e0c9e6
commit ccfca31c4e
3 changed files with 7 additions and 29 deletions

View File

@@ -11,6 +11,8 @@ CHANGELOG for FlatCAM beta
- fixed the reconnection of the mouse events when canceling setting the origin - fixed the reconnection of the mouse events when canceling setting the origin
- disabled the selection of a Graphic Engine until matplotlib will have support for PyQt6 framework - disabled the selection of a Graphic Engine until matplotlib will have support for PyQt6 framework
- removed patch to fix scaling on HIDPI displays since now the fix is implemented in VisPy v0.8.1
- modified a patch for VisPy Infinite Line Visual that set the line width, in order to make it compliant with newer versions of OpenGL
29.08.2021 29.08.2021

View File

@@ -61,19 +61,11 @@ def apply_patches():
"""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.
""" """
GL = None
from vispy.app._default_app import default_app
if default_app is not None and \ self.update_gl_state(line_smooth=False)
default_app.backend_name != 'ipynb_webgl': px_scale = self.transforms.pixel_scale
try: width = px_scale * 1.5
import OpenGL.GL as GL self.update_gl_state(line_width=max(width, 1.0))
except Exception: # can be other than ImportError sometimes
pass
if GL:
GL.glDisable(GL.GL_LINE_SMOOTH)
GL.glLineWidth(1.5)
if self._changed['pos']: if self._changed['pos']:
self.pos_buf.set_data(self._pos) self.pos_buf.set_data(self._pos)
@@ -140,19 +132,3 @@ def apply_patches():
return NotImplementedError return NotImplementedError
Ticker._get_tick_frac_labels = _get_tick_frac_labels Ticker._get_tick_frac_labels = _get_tick_frac_labels
def _resizeGL(self, w, h):
if self._vispy_canvas is None:
return
if hasattr(self, 'devicePixelRatio'):
# We take into account devicePixelRatio, which is non-unity on
# e.g HiDPI displays.
# self.devicePixelRatio() is a float and should have been in Qt5 according to the documentation
ratio = self.devicePixelRatio()
w = int(w * ratio)
h = int(h * ratio)
self._vispy_set_physical_size(w, h)
self._vispy_canvas.events.resize(size=(self.width(), self.height()),
physical_size=(w, h))
CanvasBackendDesktop.resizeGL = _resizeGL

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.0 vispy>=0.8.1
rasterio rasterio
foronoi>=1.0.3 foronoi>=1.0.3
networkx networkx