You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
406B

  1. require 'ostruct'
  2. require_relative '../control'
  3. module DHE
  4. class Line
  5. attr_reader :start, :end
  6. def initialize(faceplate:, x1:, y1:, x2:, y2:)
  7. @stroke = faceplate.foreground
  8. @x1 = x1
  9. @y1 = y1
  10. @x2 = x2
  11. @y2 = y2
  12. end
  13. def draw_faceplate(svg:)
  14. svg.line(x1: @x1, y1: @y1, x2: @x2, y2: @y2, 'stroke-width' => STROKE_WIDTH, stroke: @stroke)
  15. end
  16. end
  17. end