@jscad/svg-deserializer 2.5.6 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +3 -3
- package/tests/instantiate.test.js +1 -1
- package/tests/translate.test.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.5.7](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/svg-deserializer@2.5.6...@jscad/svg-deserializer@2.5.7) (2024-02-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **svg-serializer:** fix conversion of alpha colors to SVG RGBA opacity ([4c1f372](https://github.com/jscad/OpenJSCAD.org/commit/4c1f37271764649e192300c66d263a1fee52303c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.5.6](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/svg-deserializer@2.5.5...@jscad/svg-deserializer@2.5.6) (2023-06-27)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @jscad/svg-deserializer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jscad/svg-deserializer",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.7",
|
|
4
4
|
"description": "SVG Deserializer for JSCAD",
|
|
5
5
|
"homepage": "https://openjscad.xyz/",
|
|
6
6
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@jscad/array-utils": "2.1.4",
|
|
36
|
-
"@jscad/modeling": "2.12.
|
|
36
|
+
"@jscad/modeling": "2.12.1",
|
|
37
37
|
"saxes": "5.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"ava": "3.15.0",
|
|
41
41
|
"nyc": "15.1.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "e07bb27d61f638348c73cc1383dfb5339060a02a"
|
|
44
44
|
}
|
|
@@ -9,7 +9,7 @@ const { measurements } = require('@jscad/modeling')
|
|
|
9
9
|
test('deserialize : instantiate svg (rect) to objects', (t) => {
|
|
10
10
|
const sourceSvg = `<svg pxpmm="10" width="500" height="500">
|
|
11
11
|
<rect x="80" y="60" width="250" height="250" color="red"/>
|
|
12
|
-
<rect x="140" y="120" width="250" height="250" rx="40" color="
|
|
12
|
+
<rect x="140" y="120" width="250" height="250" rx="40" color="rgba(0,255,0)"/>
|
|
13
13
|
<rect x="140" y="120" width="250" height="250" ry="40" color="blue"/>
|
|
14
14
|
<rect x="40" y="20" width="250" height="250" transform="translate(60 50) scale(2 3)"/>
|
|
15
15
|
</svg>`
|
package/tests/translate.test.js
CHANGED
|
@@ -11,7 +11,7 @@ const deserializer = require('../src/index.js')
|
|
|
11
11
|
test('deserialize : translate svg (rect) to script', (t) => {
|
|
12
12
|
const sourceSvg = `<svg pxpmm="10" width="500" height="500">
|
|
13
13
|
<rect x="80" y="60" width="250" height="250" color="red"/>
|
|
14
|
-
<rect x="140" y="120" width="250" height="250" rx="40" color="
|
|
14
|
+
<rect x="140" y="120" width="250" height="250" rx="40" color="rgba(0,255,0)"/>
|
|
15
15
|
<rect x="140" y="120" width="250" height="250" ry="40" color="blue"/>
|
|
16
16
|
<rect x="40" y="20" width="250" height="250" rx="40" ry="40"/>
|
|
17
17
|
</svg>`
|
|
@@ -20,14 +20,14 @@ test('deserialize : translate svg (rect) to script', (t) => {
|
|
|
20
20
|
t.is(typeof obs, 'string')
|
|
21
21
|
t.is(countOf('rectangle', obs), 1)
|
|
22
22
|
t.is(countOf('roundedRectangle', obs), 3)
|
|
23
|
-
t.is(countOf('colors.colorize', obs),
|
|
23
|
+
t.is(countOf('colors.colorize', obs), 2) // color
|
|
24
24
|
t.is(countOf('path2.fromPoints', obs), 4)
|
|
25
25
|
|
|
26
26
|
obs = deserializer.deserialize({ output: 'script', target: 'geom2', addMetaData: false }, sourceSvg)
|
|
27
27
|
t.is(typeof obs, 'string')
|
|
28
28
|
t.is(countOf('rectangle', obs), 1)
|
|
29
29
|
t.is(countOf('roundedRectangle', obs), 3)
|
|
30
|
-
t.is(countOf('colors.colorize', obs),
|
|
30
|
+
t.is(countOf('colors.colorize', obs), 2) // color
|
|
31
31
|
t.is(countOf('path2.fromPoints', obs), 0)
|
|
32
32
|
})
|
|
33
33
|
|