class Lutaml::Ea::Diagram::LayoutEngine

def apply_padding_to_bounds(bounds) # rubocop:disable Metrics/AbcSize

Returns:
  • (Hash) - Padded bounds

Parameters:
  • bounds (Hash) -- Bounds with x, y, width, height
def apply_padding_to_bounds(bounds) # rubocop:disable Metrics/AbcSize
  padding_x = [bounds[:width] * 0.05, DEFAULT_PADDING].max
  padding_y = [bounds[:height] * 0.05, DEFAULT_PADDING].max
  {
    x: bounds[:x] - padding_x,
    y: bounds[:y] - padding_y,
    width: bounds[:width] + (padding_x * 2),
    height: bounds[:height] + (padding_y * 2),
  }
end