lib/wx/shapes/shapes/edit_text_shape.rb in wxruby3-shapes-0.9.0.pre.beta.3 vs lib/wx/shapes/shapes/edit_text_shape.rb in wxruby3-shapes-0.9.5
- old
+ new
@@ -28,11 +28,11 @@
evt_key_down :on_key_down
set_insertion_point_end
if @parent_shape
# update the font size in accordance to the canvas scale
- font = @parent_shape.get_font
+ font = @parent_shape.get_font.dup
font.set_point_size((font.get_point_size * @parent_shape.get_parent_canvas.get_scale).to_i)
set_font(font)
set_background_colour(Wx::Colour.new(200, 200, 200))
set_focus
@@ -166,17 +166,14 @@
EDIT_TYPE = EDITTYPE::INPLACE
end
property :force_multiline, :edit_type
- # @overload initialize()
- # Default constructor.
- # @overload initialize(pos, txt, diagram)
- # User constructor.
- # @param [Wx::RealPoint] pos Initial position
- # @param [String] txt Initial content
- # @param [Wx::SF::Diagram] diagram parent diagram
- def initialize(*args)
+ # Constructor.
+ # @param [Wx::RealPoint,Wx::Point] pos Initial position
+ # @param [String] txt Text content
+ # @param [Wx::SF::Diagram] diagram parent diagram
+ def initialize(pos = Shape::DEFAULT::POSITION, txt = TextShape::DEFAULT::TEXT, diagram: nil)
super
@text_ctrl = nil
@force_multiline = DEFAULT::FORCE_MULTILINE
@edit_type = DEFAULT::EDIT_TYPE
@current_state = 0