Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wynn
purr-data
Commits
1e0bfca4
Commit
1e0bfca4
authored
Aug 09, 2013
by
Ivica Bukvic
Browse files
added proper getscroll detection for nw anchored images (e.g. imagebang)
parent
ee89f304
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/pd.tk
View file @
1e0bfca4
...
@@ -3775,12 +3775,23 @@ proc pdtk_canvas_getscroll {name} {
...
@@ -3775,12 +3775,23 @@ proc pdtk_canvas_getscroll {name} {
set imgh [image height $img]
set imgh [image height $img]
set imgw [image width $img]
set imgw [image width $img]
set center [$name coords $item]
set center [$name coords $item]
set coords [list \
#for debugging purposes
[expr [lindex $center 0] - [expr $imgw/2]] \
#puts stderr "IMAGE: $anchor [lindex $center 0] [lindex $center 1]"
[expr [lindex $center 1] - [expr $imgh/2]] \
if { $anchor == "nw" } {
[expr [lindex $center 0] + [expr $imgw/2]] \
set coords [list \
[expr [lindex $center 1] + [expr $imgh/2]] \
[expr [lindex $center 0]] \
]
[expr [lindex $center 1]] \
[expr [lindex $center 0] + [expr $imgw]] \
[expr [lindex $center 1] + [expr $imgh]] \
]
} else {
set coords [list \
[expr [lindex $center 0] - [expr $imgw/2]] \
[expr [lindex $center 1] - [expr $imgh/2]] \
[expr [lindex $center 0] + [expr $imgw/2]] \
[expr [lindex $center 1] + [expr $imgh/2]] \
]
}
foreach {x y} $coords {
foreach {x y} $coords {
if { $x < $x1 } {set x1 $x}
if { $x < $x1 } {set x1 $x}
if { $x > $x2 } {set x2 $x}
if { $x > $x2 } {set x2 $x}
...
...
Write
Preview
Supports
Markdown
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