Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
5a2b9462
Commit
5a2b9462
authored
Jul 10, 2013
by
Luke Campagnola
Browse files
ViewBox bugfixes:
- drag rect now has large ZValue - fixed view linking with inverted y axis
parent
7cd3e663
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyqtgraph/graphicsItems/ViewBox/ViewBox.py
View file @
5a2b9462
...
@@ -139,6 +139,7 @@ class ViewBox(GraphicsWidget):
...
@@ -139,6 +139,7 @@ class ViewBox(GraphicsWidget):
self
.
rbScaleBox
=
QtGui
.
QGraphicsRectItem
(
0
,
0
,
1
,
1
)
self
.
rbScaleBox
=
QtGui
.
QGraphicsRectItem
(
0
,
0
,
1
,
1
)
self
.
rbScaleBox
.
setPen
(
fn
.
mkPen
((
255
,
255
,
100
),
width
=
1
))
self
.
rbScaleBox
.
setPen
(
fn
.
mkPen
((
255
,
255
,
100
),
width
=
1
))
self
.
rbScaleBox
.
setBrush
(
fn
.
mkBrush
(
255
,
255
,
0
,
100
))
self
.
rbScaleBox
.
setBrush
(
fn
.
mkBrush
(
255
,
255
,
0
,
100
))
self
.
rbScaleBox
.
setZValue
(
1e9
)
self
.
rbScaleBox
.
hide
()
self
.
rbScaleBox
.
hide
()
self
.
addItem
(
self
.
rbScaleBox
,
ignoreBounds
=
True
)
self
.
addItem
(
self
.
rbScaleBox
,
ignoreBounds
=
True
)
...
@@ -792,12 +793,15 @@ class ViewBox(GraphicsWidget):
...
@@ -792,12 +793,15 @@ class ViewBox(GraphicsWidget):
else
:
else
:
overlap
=
min
(
sg
.
bottom
(),
vg
.
bottom
())
-
max
(
sg
.
top
(),
vg
.
top
())
overlap
=
min
(
sg
.
bottom
(),
vg
.
bottom
())
-
max
(
sg
.
top
(),
vg
.
top
())
if
overlap
<
min
(
vg
.
height
()
/
3
,
sg
.
height
()
/
3
):
## if less than 1/3 of views overlap,
if
overlap
<
min
(
vg
.
height
()
/
3
,
sg
.
height
()
/
3
):
## if less than 1/3 of views overlap,
## then just replicate the view
## then just replicate the view
y1
=
vr
.
top
()
y1
=
vr
.
top
()
y2
=
vr
.
bottom
()
y2
=
vr
.
bottom
()
else
:
## views overlap; line them up
else
:
## views overlap; line them up
upp
=
float
(
vr
.
height
())
/
vg
.
height
()
upp
=
float
(
vr
.
height
())
/
vg
.
height
()
y2
=
vr
.
bottom
()
-
(
sg
.
y
()
-
vg
.
y
())
*
upp
if
self
.
yInverted
():
y2
=
vr
.
bottom
()
+
(
sg
.
bottom
()
-
vg
.
bottom
())
*
upp
else
:
y2
=
vr
.
bottom
()
+
(
sg
.
top
()
-
vg
.
top
())
*
upp
y1
=
y2
-
sg
.
height
()
*
upp
y1
=
y2
-
sg
.
height
()
*
upp
self
.
enableAutoRange
(
ViewBox
.
YAxis
,
False
)
self
.
enableAutoRange
(
ViewBox
.
YAxis
,
False
)
self
.
setYRange
(
y1
,
y2
,
padding
=
0
)
self
.
setYRange
(
y1
,
y2
,
padding
=
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment