mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-09-19 13:23:48 +00:00
Compare commits
2 Commits
8e7c6f8a19
...
349222f387
| Author | SHA1 | Date | |
|---|---|---|---|
| 349222f387 | |||
| 9d4bc89174 |
@@ -56,7 +56,7 @@ module CyberarmEngine
|
||||
def resolution_scaled(n)
|
||||
return n unless @style.design_width
|
||||
|
||||
((@style.design_width / Gosu.screen_width(window).to_f) * n).floor
|
||||
((Gosu.screen_width(window).to_f / @style.design_width) * n).floor
|
||||
end
|
||||
|
||||
def stylize
|
||||
|
||||
@@ -24,7 +24,16 @@ module CyberarmEngine
|
||||
# Enable child elements to display their tooltips
|
||||
# but fall back to the Widget if no hit element has a tip
|
||||
def tip
|
||||
elements = hit_element?(window.mouse_x, window.mouse_y)
|
||||
parent_scroll_position = CyberarmEngine::Vector.new
|
||||
|
||||
element = self
|
||||
while (parent_element = element.parent)
|
||||
parent_scroll_position += parent_element.scroll_position
|
||||
|
||||
element = parent_element
|
||||
end
|
||||
|
||||
elements = hit_element?(window.mouse_x - parent_scroll_position.x, window.mouse_y - parent_scroll_position.y)
|
||||
|
||||
return @tip unless elements
|
||||
|
||||
|
||||
Reference in New Issue
Block a user