Skip to content

Commit

Permalink
Fixed panzoom subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
jooste committed Mar 6, 2024
1 parent 9bcb533 commit bdaed80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bluesky/ui/qtgl/gltiledmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create(self):
self.offsetzoom_loc = glh.ShaderSet.get_shader(
'tiled').uniformLocation('offset_scale')
# Make sure that we have textures on first draw
self.texture.on_panzoom_changed(True)
self.texture.panzoom(finished=True)

def draw(self):
# Send the (possibly) updated global uniforms to the buffer
Expand Down
6 changes: 3 additions & 3 deletions bluesky/ui/qtgl/tiledtexture.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from PyQt6.QtGui import QImage, qRgba

import bluesky as bs
from bluesky.core import Signal
from bluesky.network import sharedstate as ss
from bluesky.ui.qtgl import glhelpers as glh


Expand Down Expand Up @@ -167,7 +167,7 @@ def __init__(self, glsurface, tilesource='opentopomap'):
self.indextexture = glh.Texture(target=glh.Texture.Target.Target2D)
self.indexsampler_loc = 0
self.arraysampler_loc = 0
Signal('state-change.panzoom').connect(self.panzoom)
ss.subscriber(self.panzoom, topic='PANZOOM')

def add_bounding_box(self, lat0, lon0, lat1, lon1):
''' Add the bounding box of a textured shape.
Expand Down Expand Up @@ -249,7 +249,7 @@ def bind(self, unit=0):
# Bind tile array texture to texture unit 1
super().bind(4)

def panzoom(self, pzdata, finished=False):
def panzoom(self, pzdata=None, finished=True):
''' Update textures whenever pan/zoom changes.
Arguments:
Expand Down

0 comments on commit bdaed80

Please sign in to comment.