Sha256: 8459c89cf50d9e90c69692503cf7c2c1d7ea28cd0f4facbc6a10f69593b77118
Contents?: true
Size: 711 Bytes
Versions: 101
Compression:
Stored size: 711 Bytes
Contents
module Glimmer module LibUI class ImagePathRenderer include Glimmer def initialize(area_proxy, shapes) @area_proxy = area_proxy @shapes = shapes end def render work = Proc.new do @shapes.each do |shape| path { rectangle(shape[:x], shape[:y], shape[:width], shape[:height]) fill shape[:color] } end end if @area_proxy.nil? # Ensure it renders without a parent Glimmer::DSL::Engine.add_content(nil, Glimmer::DSL::Libui::ControlExpression.new, 'image', &work) else work.call end end end end end
Version data entries
101 entries across 101 versions & 1 rubygems