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

Feature: Allow getting all staff modifiers by category, without position #728

Merged
merged 2 commits into from
Nov 27, 2019

Conversation

mix3d
Copy link
Contributor

@mix3d mix3d commented Nov 10, 2019

currently, if you want to getModifiers by category, you HAVE to have a position. This seems silly.

src/stave.js Outdated
@@ -337,6 +337,9 @@ export class Stave extends Element {
clefs[0].setType(clefSpec, size, annotation);
}

const keySignatures = this.getModifiers(position, KeySignature.CATEGORY);
Copy link
Owner

Choose a reason for hiding this comment

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

These two lines look unrelated to the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, this was my attempt to fix #727. Will remove


return this.modifiers.filter(modifier =>
position === modifier.getPosition() &&
(position === undefined || position === modifier.getPosition()) &&
Copy link
Owner

Choose a reason for hiding this comment

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

This looks safe, but I'm hesitant to accept without making sure that there were no diffs in the visual regression tests. Can you confirm please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0xfe Any suggestions on how I can confirm these tests pass? Having issues getting setup to run locally.

@mix3d
Copy link
Contributor Author

mix3d commented Nov 16, 2019

npm install + npm test:

> node ./tools/generate_png_images.js ../build ./build/images/current
Accidental :: BasicError: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)

Not sure what I'm doing wrong... but the tests ran ok

>> 681 tests completed with 0 failed, 0 skipped, and 0 todo. 
>> 3002 assertions (in 10871ms), passed: 3002, failed: 0

@0xfe
Copy link
Owner

0xfe commented Nov 26, 2019

This was a broken build config. Closing and reopening to trigger a rebuild.

@0xfe 0xfe closed this Nov 26, 2019
@0xfe 0xfe reopened this Nov 26, 2019
@0xfe
Copy link
Owner

0xfe commented Nov 27, 2019

Looks good. Merging. Thanks!

@0xfe 0xfe merged commit 41c91cd into 0xfe:master Nov 27, 2019
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