getEffectiveStrokeWidth method
Gets the effective stroke width for rendering based on selection state.
Returns the appropriate stroke width considering:
- Instance-specific strokeWidth/selectedStrokeWidth if set
- 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;
}