Sha256: 2e0e4c66827a6cf1100325584f17ed91d233b7375e274a0fb54615c519234930
Contents?: true
Size: 508 Bytes
Versions: 29
Compression:
Stored size: 508 Bytes
Contents
require 'reflex/image' require 'reflex/bitmap' require 'reflex/view' module Reflex class TextView < View has_model attr_accessor :font alias text= data= alias text data def content_bounds() s = string return 0, 0 unless s && window font = @font || window.painter.font [font.width(s), font.height].map &:ceil end def on_draw(e) s = string e.painter.push font: @font do text s end end end# TextView end# Reflex
Version data entries
29 entries across 29 versions & 1 rubygems