Skip to content

cover cache-reuse + first-change paths; fix pin color under select tool - #78

Merged
gentledepp merged 1 commit into
developfrom
fix/pin_select_color
Jul 22, 2026
Merged

cover cache-reuse + first-change paths; fix pin color under select tool#78
gentledepp merged 1 commit into
developfrom
fix/pin_select_color

Conversation

@Zeljko-Predjeskovic

Copy link
Copy Markdown
Collaborator
  • RenderCacheColorTests: add SetAttributeChangeToken unit tests (unchanged token reuses brush; first/subsequent change invalidates); drop redundant ScreenWidth/Height assignments.
  • ColorTool: color a selected pin's shape by element identity, not the active tool, so recoloring works under the Move/Selection tool. Adds PinColorSelectionTests.

Comment thread Svg.Editor.Core/Tools/ColorTool.cs Outdated
foreach (var selectedElement in _canvas.SelectedElements)
{
if (t.Canvas.ActiveTool is ISupportTextColor)
if (IsPin(selectedElement))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like, that the ColorTool now starts to learn about every other shape in our editor.

It should not have the concept of a "Pin" - it should only work with interfaces. (Open-Closed-Principle)
When I add a nother shape, I do not want to have to edit the color tool too

- RenderCacheColorTests: add SetAttributeChangeToken unit tests (unchanged
  token reuses brush; first/subsequent change invalidates); drop redundant
  ScreenWidth/Height assignments.
- ColorTool: color a selected pin's shape by element identity, not the active
  tool, so recoloring works under the Move/Selection tool. Adds
  PinColorSelectionTests.
@gentledepp
gentledepp merged commit fe96e88 into develop Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants