Sha256: e3b2e53ab81a211a39e3bee4f2c4489d198ab2c4a972b330721f8becc164de7c

Contents?: true

Size: 920 Bytes

Versions: 6

Compression:

Stored size: 920 Bytes

Contents

# frozen_string_literal: true

module DrawioDsl
  module Schema
    # Elements represents some kind of shape such as a Square, Circle, Callout, Actor, etc.
    class Element < Shape
      class << self
        def configure_as(key)
          configure_shape(key, :element)
        end
      end

      # def initialize(page, **args)
      #   args[:classification] = :anchor
      #   super(page, **args)
      # end

      def apply_defaults(args)
        super(args)

        @fill_color       = args[:fill_color]       || theme_palette.fill_color
        @stroke_color     = args[:stroke_color]     || theme_palette.stroke_color
        @gradient         = args[:gradient]         || theme_palette.gradient
        @font_color       = args[:font_color]       || theme_palette.font_color
      end

      def default_configuration
        KConfig.configuration.drawio.shape.default_element
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
drawio_dsl-0.12.4 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.12.3 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.12.2 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.12.1 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.12.0 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.11.8 lib/drawio_dsl/schema/element.rb