Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Schematic::sizeOfSelection() and its usages #1235

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

wawuwo
Copy link
Contributor

@wawuwo wawuwo commented Feb 9, 2025

Hi!

Nothing fancy comes with this PR, just a bit of refactoring to replace a recurring pattern (pseudocode):

for (comp : all_components) {
  if (!comp->isSelected) continue;
  ...
} 

Member function Schematic::sizeOfSelection() is renamed to currentSelection and is made to return not only selection bounds, but also containers with pointers to selected elements, which enables to iterate over selected elements directly:

for (comp : currentSelection().components) {
  ...
} 

@ra3xdh ra3xdh added this to the 25.1.0 milestone Feb 9, 2025
@ra3xdh ra3xdh merged commit b392e25 into ra3xdh:current Feb 10, 2025
7 checks passed
@ra3xdh
Copy link
Owner

ra3xdh commented Feb 10, 2025

Merged.

@wawuwo wawuwo deleted the refactor-schematik-size-of-selection branch February 10, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants