Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
purr-data
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nerrons
purr-data
Commits
fe74de1f
Commit
fe74de1f
authored
Aug 14, 2019
by
nerrons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: scrolling the canvas screws up xlet tooltip positions
parent
7b1c2350
Pipeline
#1638
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
pd/nw/pdgui.js
pd/nw/pdgui.js
+27
-18
No files found.
pd/nw/pdgui.js
View file @
fe74de1f
...
...
@@ -2239,7 +2239,7 @@ function gui_gobj_draw_io(cid, parenttag, tag, x1, y1, x2, y2, basex, basey,
xlet_class
=
"
xlet_control
"
;
xlet_id
=
tag
+
type
+
i
;
}
if
(
k12_mode
===
1
)
{
if
(
k12_mode
===
1
&&
type
)
{
xlet_class
+=
"
xlet_tt
"
+
type
;
// used to determine the position of the tooltip
}
rect
=
create_item
(
cid
,
"
rect
"
,
{
...
...
@@ -2287,7 +2287,7 @@ function gui_gobj_configure_io(cid, tag, is_iemgui, is_signal, width) {
}
else
if
(
is_signal
)
{
type
=
"
xlet_signal
"
;
}
else
{
"
xlet_control
"
;
type
=
"
xlet_control
"
;
}
e
.
classList
.
add
(
type
);
e
.
classList
.
remove
(
"
xlet_selected
"
);
...
...
@@ -2300,23 +2300,32 @@ function gui_gobj_configure_io(cid, tag, is_iemgui, is_signal, width) {
}
function
gui_gobj_highlight_io
(
cid
,
tag
)
{
gui
(
cid
).
get_elem
(
tag
,
function
(
e
)
{
e
.
classList
.
add
(
"
xlet_selected
"
);
if
(
k12_mode
===
1
&&
(
e
.
classList
.
contains
(
"
xlet_tti
"
)
||
e
.
classList
.
contains
(
"
xlet_tto
"
)))
{
gui
(
cid
).
get_elem
(
"
xlet_tt
"
,
function
(
tt
)
{
var
e_rect
=
e
.
getBoundingClientRect
(),
e_x
=
e_rect
.
left
,
e_y
=
e_rect
.
top
;
tt
.
innerHTML
=
k12_xlet_tt
[
e
.
parentNode
.
getAttribute
(
"
ttid
"
)][
tag
.
slice
(
-
2
)];
tt
.
style
.
display
=
"
block
"
;
tt
.
style
.
left
=
e_x
+
10
+
"
px
"
;
if
(
e
.
classList
.
contains
(
"
xlet_tti
"
))
{
tt
.
style
.
top
=
e_y
+
3
+
"
px
"
;
}
else
{
tt
.
style
.
top
=
e_y
-
10
+
"
px
"
;
gui
(
cid
).
get_nw_window
(
function
(
nw_win
)
{
var
xlet
=
nw_win
.
window
.
document
.
getElementById
(
tag
);
if
(
xlet
)
{
xlet
.
classList
.
add
(
"
xlet_selected
"
);
// for K12 abstraction xlets, show tooltips at mouse position
if
(
k12_mode
===
1
&&
(
xlet
.
classList
.
contains
(
"
xlet_tti
"
)
||
xlet
.
classList
.
contains
(
"
xlet_tto
"
)))
{
var
tt
=
nw_win
.
window
.
document
.
getElementById
(
"
xlet_tt
"
),
xlet_rect
=
xlet
.
getBoundingClientRect
(),
xlet_x
=
xlet_rect
.
left
,
xlet_y
=
xlet_rect
.
top
,
win_left
=
nw_win
.
window
.
document
.
body
.
scrollLeft
,
win_top
=
nw_win
.
window
.
document
.
body
.
scrollTop
,
abstraction_tt
=
k12_xlet_tt
[
xlet
.
parentNode
.
getAttribute
(
"
ttid
"
)];
if
(
abstraction_tt
)
{
tt
.
innerHTML
=
abstraction_tt
[
tag
.
slice
(
-
2
)];
tt
.
style
.
display
=
"
block
"
;
tt
.
style
.
left
=
xlet_x
+
win_left
+
10
+
"
px
"
;
if
(
xlet
.
classList
.
contains
(
"
xlet_tti
"
))
{
tt
.
style
.
top
=
xlet_y
+
win_top
+
3
+
"
px
"
;
}
else
{
var
tt_height
=
tt
.
offsetHeight
;
tt
.
style
.
top
=
xlet_y
+
win_top
-
tt_height
+
"
px
"
;
}
}
}
);
}
}
});
}
...
...
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