8000 Added border width to Rectangle Object · SciRuby/rubyplot@cd6a084 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd6a084

Browse files
committed
Added border width to Rectangle Object
1 parent ee12d9d commit cd6a084

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/rubyplot/artist/rectangle.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Rubyplot
22
module Artist
33
class Rectangle < Base
4-
attr_reader :x1, :x2, :y1, :y2, :border_color, :fill_color
4+
attr_reader :x1, :x2, :y1, :y2, :border_color, :border_width, :fill_color
55

66
# Create a Rectangle for drawing on the canvas.
77
#
@@ -11,16 +11,18 @@ class Rectangle < Base
1111
# @param y2 [Float] Y co-ordinate of upper right corner.
1212
# @param border_color [Symbol] Symbol from Rubyplot::Color::COLOR_INDEX
1313
# denoting border color.
14+
# @param border_width [Float] Width of the border.
1415
# @param fill_color [Symbol] nil Symbol from Rubyplot::Color::COLOR_INDEX
1516
# denoting the fill color.
1617
# @param abs [FalseClass|TrueClass] false Whether the co-ordinates are absolute co-ordinates.
1718
# rubocop:disable Metrics/ParameterLists
18-
def initialize(owner,x1:,y1:,x2:,y2:,border_color:,fill_color: nil, abs: false)
19+
def initialize(owner,x1:,y1:,x2:,y2:,border_color:,border_width: 1.0,fill_color: nil, abs: false)
1920
@x1 = x1
2021
@x2 = x2
2122
@y1 = y1
2223
@y2 = y2
2324
@border_color = border_color
25+
@border_width = border_width
2426
@fill_color = fill_color
2527
@abs = abs
2628
end
@@ -33,6 +35,7 @@ def draw
3335
x2: @x2,
3436
y2: @y2,
3537
border_color: @border_color,
38+
border_width: @border_width,
3639
fill_color: @fill_color,
3740
abs: @abs
3841
)

0 commit comments

Comments
 (0)
0