Sha256: 8f8a9eefc42b7e68e019b5976a58313ea1c00e756348de99208324e1d9b90bd6
Contents?: true
Size: 917 Bytes
Versions: 10
Compression:
Stored size: 917 Bytes
Contents
# encoding: utf-8 module Fidgit class ToolTip < TextLine def x=(value); super(value); recalc; value; end def y=(value); super(value); recalc; value; end def hit?(x, y); false; end # @param (see Label#initialize) # # @option (see Label#initialize) def initialize(options = {}, &block) options = { z: Float::INFINITY, background_color: default(:background_color), border_color: default(:border_color), text: '', }.merge! options super(options[:text], options) end protected def layout super # Ensure the tip can't go over the edge of the screen. If it can't be avoided, align with left edge of screen. rect.x = [[x, $window.width - width - padding_right].min, 0].max rect.y = [[y, $window.height - height - padding_bottom].min, 0].max nil end end end
Version data entries
10 entries across 10 versions & 1 rubygems