Sha256: ef6cd20cb7881bc629b7b335beb77fd3e3d135f6a1d50d16e8430454e9427e14
Contents?: true
Size: 914 Bytes
Versions: 11
Compression:
Stored size: 914 Bytes
Contents
# encoding: utf-8 module Fidgit class ToolTip < Label 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
11 entries across 11 versions & 1 rubygems