mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
Fixed Image and EditLine sizing messed out
This commit is contained in:
@@ -66,7 +66,7 @@ module CyberarmEngine
|
|||||||
@children.each do |child|
|
@children.each do |child|
|
||||||
child.x += @x
|
child.x += @x
|
||||||
child.y += @y
|
child.y += @y
|
||||||
|
|
||||||
child.stylize
|
child.stylize
|
||||||
child.recalculate
|
child.recalculate
|
||||||
child.reposition # TODO: Implement top,bottom,left,center, and right positioning
|
child.reposition # TODO: Implement top,bottom,left,center, and right positioning
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module CyberarmEngine
|
|||||||
_container = Flow.new(options, block)
|
_container = Flow.new(options, block)
|
||||||
@containers << _container
|
@containers << _container
|
||||||
_container.build
|
_container.build
|
||||||
options[:parent].add(_container)
|
_container.parent.add(_container)
|
||||||
@containers.pop
|
@containers.pop
|
||||||
|
|
||||||
return _container
|
return _container
|
||||||
@@ -18,7 +18,7 @@ module CyberarmEngine
|
|||||||
_container = Stack.new(options, block)
|
_container = Stack.new(options, block)
|
||||||
@containers << _container
|
@containers << _container
|
||||||
_container.build
|
_container.build
|
||||||
options[:parent].add(_container)
|
_container.parent.add(_container)
|
||||||
@containers.pop
|
@containers.pop
|
||||||
|
|
||||||
return _container
|
return _container
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ module CyberarmEngine
|
|||||||
|
|
||||||
@type = default(:type)
|
@type = default(:type)
|
||||||
|
|
||||||
|
|
||||||
@caret_width = default(:caret_width)
|
@caret_width = default(:caret_width)
|
||||||
@caret_height= @text.height
|
@caret_height= @text.height
|
||||||
@caret_color = default(:caret_color)
|
@caret_color = default(:caret_color)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module CyberarmEngine
|
|||||||
attr_reader :parent, :options, :style, :event_handler, :background_canvas, :border_canvas
|
attr_reader :parent, :options, :style, :event_handler, :background_canvas, :border_canvas
|
||||||
|
|
||||||
def initialize(options = {}, block = nil)
|
def initialize(options = {}, block = nil)
|
||||||
@parent = options[:parent] # parent Container (i.e. flow/stack)
|
@parent = options.delete(:parent) # parent Container (i.e. flow/stack)
|
||||||
options = theme_defaults(options)
|
options = theme_defaults(options)
|
||||||
@options = options
|
@options = options
|
||||||
@block = block
|
@block = block
|
||||||
@@ -26,15 +26,15 @@ module CyberarmEngine
|
|||||||
@fixed_x = @x if @x != 0
|
@fixed_x = @x if @x != 0
|
||||||
@fixed_y = @y if @y != 0
|
@fixed_y = @y if @y != 0
|
||||||
|
|
||||||
|
@style.width = default(:width) || $window.width
|
||||||
|
@style.height = default(:height) || $window.height
|
||||||
|
|
||||||
stylize
|
stylize
|
||||||
|
|
||||||
default_events
|
default_events
|
||||||
end
|
end
|
||||||
|
|
||||||
def stylize
|
def stylize
|
||||||
@style.width = @style.width || $window.width
|
|
||||||
@style.height = @style.height || $window.height
|
|
||||||
|
|
||||||
set_border_thickness(@style.border_thickness)
|
set_border_thickness(@style.border_thickness)
|
||||||
|
|
||||||
set_padding(@style.padding)
|
set_padding(@style.padding)
|
||||||
|
|||||||
@@ -1,7 +1,24 @@
|
|||||||
|
module Gosu
|
||||||
|
class Color
|
||||||
|
def _dump(level)
|
||||||
|
[
|
||||||
|
"%02X" % self.alpha,
|
||||||
|
"%02X" % self.red,
|
||||||
|
"%02X" % self.green,
|
||||||
|
"%02X" % self.blue
|
||||||
|
].join
|
||||||
|
end
|
||||||
|
|
||||||
|
def self._load(hex)
|
||||||
|
argb(hex.to_i(16))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module CyberarmEngine
|
module CyberarmEngine
|
||||||
class Style
|
class Style
|
||||||
def initialize(hash = {})
|
def initialize(hash = {})
|
||||||
@hash = hash
|
@hash = Marshal.load(Marshal.dump(hash))
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_missing(method, *args, &block)
|
def method_missing(method, *args, &block)
|
||||||
|
|||||||
Reference in New Issue
Block a user