Sha256: 3103ea0c2b6c79543597ef813f15c797f3bd0c09e88a282f037dfa26247788af

Contents?: true

Size: 723 Bytes

Versions: 3

Compression:

Stored size: 723 Bytes

Contents

# frozen_string_literal: true

module DrawioDsl
  module DrawioExtensionsActive
    def apply_active_flags
      sections.each do |section|
        section[:shapes].each do |shape|
          shape[:active] = check_if_active(shape)
        end
        section[:active] = section[:shapes].any? { |s| s[:active] }
      end
    end

    def check_if_active(shape)
      style = shape[:style]

      ban = %w[
        mxCompositeShape
        strokeColor=none;fillColor=none
        shape=image
        shadow=1
        shape=partialRectangle;right=0
        shape=partialRectangle;right=0;left=0
      ]

      puts 33
      return false if style.empty?
      return false if ban.include?(style)

      true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
drawio_dsl-0.11.7 lib/drawio_dsl/drawio_extensions_active.rb
drawio_dsl-0.11.6 lib/drawio_dsl/drawio_extensions_active.rb
drawio_dsl-0.11.5 lib/drawio_dsl/drawio_extensions_active.rb