Skip to content

Commit 2ff6faf

Browse files
author
Nicholas Schwaderer
committed
pass more examples
1 parent b444fc5 commit 2ff6faf

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

examples/legacy/for_playtest/shoes3-tests/wheel/wheel1.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# CHECKED BY SCHWAD
2+
13
Shoes.app do
24
stack height: 200 do
35
click do |b,l,t|
@@ -19,5 +21,9 @@
1921
end
2022
end
2123
end
24+
stack height: 200 do
25+
border blue, strokewidth: 2
26+
para "Stack 2"
27+
end
2228
wheel {|d,l,t,mods | @p.replace "default slot wheel #{d} #{mods}"}
2329
end

lib/scarpe/wv/subscription_item.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,11 @@ def set_parent(new_parent)
165165
# Wheel event (mouse wheel / trackpad scroll). Positive delta = scroll up/away from user.
166166
# In browsers, deltaY is positive when scrolling down (content moves up), which is
167167
# opposite to what Shoes3 expects. We negate it for Shoes compatibility.
168+
# stopPropagation prevents the event from bubbling to parent slots.
168169
new_parent.set_event_callback(
169170
self,
170171
"onwheel",
171-
handler_js_code(
172+
"arguments[0].stopPropagation();" + handler_js_code(
172173
@shoes_api_name,
173174
"-arguments[0].deltaY", # Negate for Shoes3 convention: positive = up
174175
"arguments[0].clientX",

scarpe-components/lib/scarpe/components/calzini/slots.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def slot_style(props)
8484
# Other attach values (another drawable) would need more complex handling
8585
end
8686

87-
## A new slot defines a new coordinate system, so absolutely-positioned children
88-
## are relative to it. But that's going to need a lot of testing and Shoes3 comparison.
89-
#styles[:position] = "relative"
87+
# Slots need position:relative so that absolutely-positioned children
88+
# (like Border drawables) anchor to their parent slot, not the window.
89+
styles[:position] = "relative" unless styles[:position]
9090

9191
styles
9292
end

0 commit comments

Comments
 (0)