Commit Graph

641 Commits

Author SHA1 Message Date
Maximilian Krög 87f215939c Fix some RegularShape bugs related to canvsa size
- remove jitter when using RegularShape size in animation, size should
always be an integer
- canvas may have been too small for miter line join
- canvas was at least one stroke width too large for round line join
- reduce canvas size even more for bevel line join

Canvas now precisely fits the shape including stroke, The angle of the
shape is ignored for the calculation.
2021-07-11 12:32:03 +02:00
Maximilian Krög f21513ab5a Consistent behaviour if two radii are provided
Always double the points event when two radii of same size are provided.
2021-07-11 12:32:03 +02:00
Maximilian Krög 28c40fe93e getImage is always called with valid pixelRatio 2021-07-11 12:32:03 +02:00
Maximilian Krög 5716c614a8 Cleanup drawing of RegularShape
Fixes missing miter/bevel line join because path was not closed before
stroking.
Reduce canvas context calls, skip beginPath, and instead of drawing the
last point use closePath
2021-07-11 12:31:55 +02:00
Maximilian Krög 82265ef031 No unnecessary canvas with transparent fill
With pixelRatio != 1 and a transparent fill a unnecessary image was created.
2021-07-11 12:30:18 +02:00
Andreas Hocevar 79f5f46d27 Remove lint 2021-06-28 18:10:51 +02:00
Maximilian Krög 1fc94337f7 Fix icon tinting with pixelRatio < 1 2021-06-21 00:13:55 +02:00
Tim Schaub f08f31101c Lowercase module names for modules without a default export 2021-05-03 07:32:12 -06:00
Andreas Hocevar 4a6db3d2f8 Fix icon displacement 2021-04-01 12:08:32 +02:00
Tim Schaub a7684d8fbf Avoid colliding user variables with internal names 2021-02-11 07:38:46 -07:00
Tim Schaub c9a3b3bf92 Throw when parsing encounters an unexpected type 2021-02-10 19:18:55 -07:00
mike-000 1c47d268fb Correct pixel ratio description 2021-02-06 13:49:48 +00:00
Simon Seyock 2ad5789797 Add descriptions for properties. 2021-02-04 18:19:33 +01:00
Simon Seyock 8facb252f1 Replace google closure syntax = with brackets around name 2021-02-03 14:06:02 +01:00
Simon Seyock c15faa19fc enable check-types 2021-02-03 13:59:34 +01:00
Simon Seyock 808868ad1f Fixed some jsdoc issues. 2021-02-02 12:15:30 +01:00
Simon Seyock f590cb3473 Harmonize jsdoc 2021-02-02 12:14:56 +01:00
mjjurkoic 1842170b20 Eliminate redundant code
Co-authored-by: Stéphane Brunner <stephane.brunner@camptocamp.com>
2021-01-08 09:21:49 -08:00
Michael Jurkoic 81901c72c4 Pass the renderer function to the cloned style 2021-01-07 22:33:08 -08:00
Maximilian Krög d2027c1640 Get value type only once 2020-12-19 14:12:37 +01:00
Maximilian Krög 8363e66d1e Fix error message for assertArgsOdd failure 2020-12-19 14:12:37 +01:00
mike-000 685040347b Add rotation and rotateWithView
Add rotation and rotateWithView to options and clone

Add rotation and rotateWithView to clone test
Also check that scale and displacement arrays are cloned
2020-09-08 16:23:45 +01:00
mike-000 0807b44722 Clear this.canvas_ whenever render() is called 2020-09-01 09:27:17 +01:00
mike-000 f897503e10 Cosmetic fix to doc (missing closing quote) 2020-08-28 22:27:33 +01:00
Andreas Hocevar f0170f378f Merge pull request #11418 from MoonE/icon-color-default-to-composite-operation
Icon color default to composite operation
2020-08-11 20:57:40 +02:00
Maximilian Krög 558b3a3ed2 Support alpha channel for icon tinting 2020-08-09 21:58:33 +02:00
Maximilian Krög 38ecaa9814 Use compositing operation for icon colorization when possible. 2020-08-09 21:58:33 +02:00
mike-000 722e0c5b69 Include scale in options
Add rectangle to example
Add ellipse and rectangle to rendering tests
2020-08-09 10:25:16 +01:00
Andreas Hocevar ac5f52a21f Hit detect everything with a pixel ratio of 1 2020-07-27 19:56:35 +02:00
Andreas Hocevar 5b84b2470c Merge pull request #11277 from sbrunner/hires-regularshape-master
Have high resolution regular shape
2020-07-26 12:39:44 +02:00
Andreas Hocevar 2e781afd56 Use static test context for tainted canvas 2020-07-26 12:12:57 +02:00
Stéphane Brunner f6061f0589 Don't creates too many canvas 2020-07-17 11:22:29 +02:00
michael ryding b25d7bc58a Added all and any operator 2020-07-16 09:03:00 +01:00
Stéphane Brunner fd1effa992 High resolution icon 2020-07-15 16:30:24 +02:00
Stéphane Brunner f2fe6e5957 Have high resolution regular shape 2020-07-15 10:53:20 +02:00
mike-000 cf0e650435 allow scale to be two dimensional
add getScaleArray() method

test two dimension scale icons
test two dimension scale text

add example of icon and label scaling
use smaller icon and larger interval
test two dimensional scale icons
test two dimensional scale icons
2020-05-20 09:54:47 +01:00
Tim Schaub 054af09032 Make code prettier
This updates ESLint and our shared eslint-config-openlayers to use Prettier.  Most formatting changes were automatically applied with this:

    npm run lint -- --fix

A few manual changes were required:

 * In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
 * In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason.  While editing this, I reworked `ExampleBuilder` to be a class.
 * In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
2020-04-06 12:54:09 -06:00
Frederic Junod 506aa7aae7 Remove all inheritDoc tags from src/ol/style 2020-04-03 07:56:58 +02:00
Andreas Hocevar 5e8102bbd1 Merge pull request #10850 from ahocevar/enum-docs
API docs for enums
2020-04-01 11:47:55 +02:00
Andreas Hocevar a6a5b72c57 Only mark items as api, not enums 2020-03-27 12:33:54 +01:00
Maximilian Krög 1020c384bb Fix two missing apidoc links
Add IconAnchorUnits and IconOrigin to the api.
2020-03-27 12:33:54 +01:00
Maximilian Krög 24f9e1c6ac Update comment for the IconImage replaceColor_ method 2020-03-22 13:29:29 +01:00
Maximilian Krög fbb0364ea5 Make Icon's color attribute work in ie11 2020-03-21 00:33:41 +01:00
Andreas Hocevar 6b9791eeed Fix stylefunction return type 2020-02-20 11:47:42 +01:00
Andreas Hocevar 13713bab51 Fix type and documentation of style function 2020-02-20 11:09:12 +01:00
jkonieczny 2112478b6b Added test + jsdoc 2020-01-15 11:13:45 +01:00
jkonieczny 78378f0253 refactor offset to displacement 2020-01-15 11:13:45 +01:00
jkonieczny 4c7f52c8a4 Offset for ImageStyle 2020-01-15 11:13:44 +01:00
jkonieczny 1506e13b60 use anchor for offsetting 2020-01-15 11:13:44 +01:00
jkonieczny 601bd7bae6 add offset option to RegularShape 2020-01-15 11:13:44 +01:00