getEffectiveStrokeWidth method

double getEffectiveStrokeWidth(
  1. double themeStrokeWidth,
  2. double themeSelectedStrokeWidth
)

Gets the effective stroke width for rendering based on selection state.

Returns the appropriate stroke width considering:

  1. Instance-specific strokeWidth/selectedStrokeWidth if set
  2. Theme stroke widths as fallback

Parameters:

  • themeStrokeWidth: The default stroke width from the theme (non-selected)
  • themeSelectedStrokeWidth: The default selected stroke width from the theme

Returns: The stroke width to use for rendering this connection

Implementation

double getEffectiveStrokeWidth(
  double themeStrokeWidth,
  double themeSelectedStrokeWidth,
) {
  if (selected) {
    return selectedStrokeWidth ?? themeSelectedStrokeWidth;
  }
  return strokeWidth ?? themeStrokeWidth;
}