mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 05:02:34 +00:00
added Element#inner_width and Element#inner_height methods, EditLine now resets caret blink cycle when clicked
This commit is contained in:
@@ -162,7 +162,7 @@ module CyberarmEngine
|
||||
|
||||
def width
|
||||
if visible?
|
||||
(@style.border_thickness_left + @style.padding_left) + @width + (@style.padding_right + @style.border_thickness_right)
|
||||
inner_width + @width
|
||||
else
|
||||
0
|
||||
end
|
||||
@@ -172,9 +172,13 @@ module CyberarmEngine
|
||||
@style.margin_left + width + @style.margin_right
|
||||
end
|
||||
|
||||
def inner_width
|
||||
(@style.border_thickness_left + @style.padding_left) + (@style.padding_right + @style.border_thickness_right)
|
||||
end
|
||||
|
||||
def height
|
||||
if visible?
|
||||
(@style.border_thickness_top + @style.padding_top) + @height + (@style.padding_bottom + @style.border_thickness_bottom)
|
||||
inner_height + @height
|
||||
else
|
||||
0
|
||||
end
|
||||
@@ -184,6 +188,10 @@ module CyberarmEngine
|
||||
@style.margin_top + height + @style.margin_bottom
|
||||
end
|
||||
|
||||
def inner_height
|
||||
(@style.border_thickness_top + @style.padding_top) + (@style.padding_bottom + @style.border_thickness_bottom)
|
||||
end
|
||||
|
||||
private def dimensional_size(size, dimension)
|
||||
raise "dimension must be either :width or :height" unless dimension == :width || dimension == :height
|
||||
if size && size.is_a?(Numeric)
|
||||
|
||||
@@ -43,6 +43,9 @@ module CyberarmEngine
|
||||
def left_mouse_button(sender, x, y)
|
||||
super
|
||||
window.text_input = @text_input
|
||||
|
||||
@caret_last_interval = Gosu.milliseconds
|
||||
@show_caret = true
|
||||
end
|
||||
|
||||
def enter(sender)
|
||||
|
||||
Reference in New Issue
Block a user