Sha256: ac95f314af5b4b89e1d3966621e13ddede96a0e85feb8e4913e7f67d7a82f99c
Contents?: true
Size: 691 Bytes
Versions: 21
Compression:
Stored size: 691 Bytes
Contents
# The draw cycle is responsible for queueing redraws until all of the events have # fired. Once that is done, everything will be redrawn. This prevents bindings # from being drawn multiple times before all events have propigated. class DrawCycle def initialize @queue = {} @timer = nil end def queue(binding) @queue[binding] = true unless @timer # Flush once everything else has finished running @timer = `setTimeout(function() { self.$flush(); }, 0);` end end def flush @timer = nil work_queue = @queue @queue = {} work_queue.each_pair do |binding,_| # Call the update if queued binding.update end end end
Version data entries
21 entries across 21 versions & 1 rubygems