Sha256: 5271bffffb8b8e0051e21160057ab3a52994da4cce10f587ee09a4271c626dd5

Contents?: true

Size: 798 Bytes

Versions: 6

Compression:

Stored size: 798 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 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.11.7 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.11.6 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.11.5 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.11.4 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.11.3 lib/drawio_dsl/schema/element.rb
drawio_dsl-0.11.2 lib/drawio_dsl/schema/element.rb