Sha256: f86b59c0dd72e26657f58ec8ddef4500f3e9ac71c0421ad9327b6733a6efdd6b
Contents?: true
Size: 937 Bytes
Versions: 29
Compression:
Stored size: 937 Bytes
Contents
# encoding: ascii-8bit # Copyright 2014 Ball Aerospace & Technologies Corp. # All Rights Reserved. # # This program is free software; you can modify and/or redistribute it # under the terms of the GNU General Public License # as published by the Free Software Foundation; version 3 with # attribution addendums as found in the LICENSE.txt require 'cosmos/tools/tlm_viewer/widgets/widget' module Cosmos class CanvaslabelWidget include Widget def initialize(parent_layout, x, y, text, font_size = 12, color='black') super() @x = x.to_i @y = y.to_i @text = text @color = Cosmos::getColor(color) @font = Cosmos.getFont("helvetica", font_size.to_i) parent_layout.add_repaint(self) end def paint(painter) painter.save painter.setPen(@color) painter.setFont(@font) painter.drawText(@x, @y, @text) painter.restore end end end # module Cosmos
Version data entries
29 entries across 29 versions & 1 rubygems