lib/rabbit/renderer/display/base.rb in rabbit-2.1.6 vs lib/rabbit/renderer/display/base.rb in rabbit-2.1.7
- old
+ new
@@ -33,10 +33,15 @@
else
nil
end
end
+ def size
+ refresh_size
+ @size
+ end
+
def redraw
widget.queue_draw
end
def attach_to(window, container=nil)
@@ -138,11 +143,12 @@
end
private
def set_drawable(drawable)
@drawable = drawable
- w, h = @drawable.size
+ w = @drawable.width
+ h = @drawable.height
@default_size_ratio = w.to_f / h.to_f
@size_ratio = @default_size_ratio
set_size(w, h)
end
@@ -160,11 +166,12 @@
end
def refresh_size
return unless @size_dirty
- w, h = @drawable.size
- @size = Size.new(w, h, @size.ratio)
+ @size = Size.new(@drawable.width,
+ @drawable.height,
+ @size.ratio)
@size_dirty = false
end
def set_configure_event
id = @window.signal_connect("configure_event") do |widget, event|