Facepalm, align overlay plot view exactly to parent
Previously we were aligning the child's `PlotItem` to the "root" (top most) overlays `ViewBox`..smh. This is why there was a weird gap on the LHS next to the 'left' price axes: something weird in the implied axes offsets was getting jammed in that rect. Also comments out "the-skipping-of" moving axes from the overlay's `PlotItem.layout` to the root's linear layout(s) when an overlay's axis is read as not visible; this isn't really necessary nor useful and if we want to remove the axes entirely we should do it explicitly and/or provide a way through the `ComposeGridLayout` API.storage_cli
parent
a2934b7d18
commit
fd1fd8d49b
|
@ -201,18 +201,19 @@ class ComposedGridLayout:
|
||||||
axis_view = axis.linkedView()
|
axis_view = axis.linkedView()
|
||||||
assert axis_view is plotitem.vb
|
assert axis_view is plotitem.vb
|
||||||
|
|
||||||
if (
|
# if (
|
||||||
not axis.isVisible()
|
# not axis.isVisible()
|
||||||
|
|
||||||
# XXX: we never skip moving the axes for the *root*
|
# # XXX: we never skip moving the axes for the *root*
|
||||||
# plotitem inserted (even if not shown) since we need to
|
# # plotitem inserted (even if not shown) since we need to
|
||||||
# move all the hidden axes into linear sub-layouts for
|
# # move all the hidden axes into linear sub-layouts for
|
||||||
# that "central" plot in the overlay. Also if we don't
|
# # that "central" plot in the overlay. Also if we don't
|
||||||
# do it there's weird geomoetry calc offsets that make
|
# # do it there's weird geomoetry calc offsets that make
|
||||||
# view coords slightly off somehow .. smh
|
# # view coords slightly off somehow .. smh
|
||||||
and not len(self.pitems) == 0
|
# and not len(self.pitems) == 0
|
||||||
):
|
# ):
|
||||||
continue
|
# print(f'SKIPPING MOVE: {plotitem.name}:{name} -> {axis}')
|
||||||
|
# continue
|
||||||
|
|
||||||
# invert insert index for layouts which are
|
# invert insert index for layouts which are
|
||||||
# not-left-to-right, top-to-bottom insert oriented
|
# not-left-to-right, top-to-bottom insert oriented
|
||||||
|
@ -498,10 +499,10 @@ class PlotItemOverlay:
|
||||||
else:
|
else:
|
||||||
insert_index, axes = self.layout.insert_plotitem(index, plotitem)
|
insert_index, axes = self.layout.insert_plotitem(index, plotitem)
|
||||||
|
|
||||||
plotitem.setGeometry(root.vb.sceneBoundingRect())
|
plotitem.vb.setGeometry(root.vb.sceneBoundingRect())
|
||||||
|
|
||||||
def size_to_viewbox(vb: 'ViewBox'):
|
def size_to_viewbox(vb: 'ViewBox'):
|
||||||
plotitem.setGeometry(vb.sceneBoundingRect())
|
plotitem.vb.setGeometry(root.vb.sceneBoundingRect())
|
||||||
|
|
||||||
root.vb.sigResized.connect(size_to_viewbox)
|
root.vb.sigResized.connect(size_to_viewbox)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue