@thi.ng/rasterize 1.0.11 → 1.0.13
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 +7 -1
- package/README.md +2 -2
- package/package.json +10 -10
- package/rect.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2022-12-
|
|
3
|
+
- **Last updated**: 2022-12-22T21:47:07Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [1.0.13](https://github.com/thi-ng/umbrella/tree/@thi.ng/rasterize@1.0.13) (2022-12-22)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update drawRect() (rows2d iterator changes) ([a77ee60](https://github.com/thi-ng/umbrella/commit/a77ee60))
|
|
17
|
+
|
|
12
18
|
# [1.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/rasterize@1.0.0) (2022-09-27)
|
|
13
19
|
|
|
14
20
|
#### 🛑 Breaking changes
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This project is part of the
|
|
|
27
27
|
|
|
28
28
|
## About
|
|
29
29
|
|
|
30
|
-
2D shape drawing & rasterization
|
|
30
|
+
2D shape drawing & rasterization.
|
|
31
31
|
|
|
32
32
|
The functions in this package can be used with any
|
|
33
33
|
[`IGrid2D`](https://docs.thi.ng/umbrella/api/interfaces/IGrid2D.html) compatible
|
|
@@ -151,7 +151,7 @@ For Node.js REPL:
|
|
|
151
151
|
const rasterize = await import("@thi.ng/rasterize");
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 1.
|
|
154
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 1.48 KB
|
|
155
155
|
|
|
156
156
|
## Dependencies
|
|
157
157
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rasterize",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "2D shape drawing & rasterization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.6.
|
|
38
|
-
"@thi.ng/checks": "^3.3.
|
|
39
|
-
"@thi.ng/equiv": "^2.1.
|
|
40
|
-
"@thi.ng/grid-iterators": "^
|
|
41
|
-
"@thi.ng/porter-duff": "^2.1.
|
|
42
|
-
"@thi.ng/random": "^3.3.
|
|
43
|
-
"@thi.ng/transducers": "^8.3.
|
|
37
|
+
"@thi.ng/api": "^8.6.2",
|
|
38
|
+
"@thi.ng/checks": "^3.3.6",
|
|
39
|
+
"@thi.ng/equiv": "^2.1.16",
|
|
40
|
+
"@thi.ng/grid-iterators": "^3.0.0",
|
|
41
|
+
"@thi.ng/porter-duff": "^2.1.22",
|
|
42
|
+
"@thi.ng/random": "^3.3.20",
|
|
43
|
+
"@thi.ng/transducers": "^8.3.28"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@microsoft/api-extractor": "^7.33.7",
|
|
47
|
-
"@thi.ng/testament": "^0.3.
|
|
47
|
+
"@thi.ng/testament": "^0.3.8",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"tools": "^0.0.1",
|
|
50
50
|
"typedoc": "^0.23.22",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"status": "alpha",
|
|
120
120
|
"year": 2021
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "bc6f7f5e2765bb96fe64db804eaf4b2443b47fc6\n"
|
|
123
123
|
}
|
package/rect.js
CHANGED
|
@@ -19,7 +19,10 @@ export const drawRect = (grid, x, y, w, h, val, fill = false) => {
|
|
|
19
19
|
h += y;
|
|
20
20
|
y = 0;
|
|
21
21
|
}
|
|
22
|
-
const pts = rows2d(
|
|
22
|
+
const pts = rows2d({
|
|
23
|
+
cols: Math.min(w, width - x),
|
|
24
|
+
rows: Math.min(h, height - y),
|
|
25
|
+
});
|
|
23
26
|
const shader = ensureShader2D(val);
|
|
24
27
|
if (isPrimitive(val)) {
|
|
25
28
|
for (let { 0: xx, 1: yy } of pts) {
|