# File lib/rabbit/image/base.rb, line 21 def [](key) @props[normalize_prop_key(key)] end
# File lib/rabbit/image/base.rb, line 25 def []=(key, value) @props[normalize_prop_key(key)] = value end
# File lib/rabbit/image/base.rb, line 62 def draw(canvas, x, y, params={}) default_params = { :width => width, :height => height, } canvas.draw_pixbuf(pixbuf, x, y, default_params.merge(params)) end
# File lib/rabbit/image/base.rb, line 29 def keep_ratio self["keep_ratio"] end
# File lib/rabbit/image/base.rb, line 33 def keep_ratio=(value) self["keep_ratio"] = value end
# File lib/rabbit/image/base.rb, line 41 def resize(w, h) if w.nil? and h.nil? return elsif keep_ratio if w and h.nil? h = (original_height * w.to_f / original_width).ceil elsif w.nil? and h w = (original_width * h.to_f / original_height).ceil end else w ||= width h ||= height end w = w.ceil if w h = h.ceil if h if w and w > 0 and h and h > 0 and [w, h] != [width, height] @width = w @height = h end end
Generated with the Darkfish Rdoc Generator 2.