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

options.offset type is incomplete in both style/FillPattern.js and style/StrokePattern.js #955

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

Pigeo
Copy link
Contributor

@Pigeo Pigeo commented Jun 8, 2023

In both style/FillPattern.js and style/StrokePattern.js, parameter options.offset is typed as:

@param {number} options.offset pattern offset for hash/dot/circle/cross pattern

However, the code in both classes also accepts an 2-dimensional array of numbers [x,y], and this is sometimes a must-have option (for ex. if you have hatches oriented at an angle of 135°, you can't simply pass a single number in the options.offset: it won't work! In such cases, you definitely need to pass an array of 2 different numbers).

Thus, the correct code should be:

@param {number|[number, number]} options.offset pattern offset for hash/dot/circle/cross pattern

Note that it also impacts incorrect (incomplete) types to be generated by Siedlrchr/types-ol-ext.

Thanks for all your amazing work on this project,
Best regards

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.

None yet

2 participants