@sequent-org/moodboard 1.2.45 → 1.2.46
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/package.json +1 -1
- package/src/grid/CrossGrid.js +15 -6
- package/src/grid/GridFactory.js +6 -6
package/package.json
CHANGED
package/src/grid/CrossGrid.js
CHANGED
|
@@ -24,19 +24,28 @@ export class CrossGrid extends BaseGrid {
|
|
|
24
24
|
*/
|
|
25
25
|
createVisual() {
|
|
26
26
|
const g = this.graphics;
|
|
27
|
-
// Прозрачность
|
|
28
|
-
g.
|
|
27
|
+
// Прозрачность — через alpha графики (как у линейной сетки)
|
|
28
|
+
g.alpha = this.opacity;
|
|
29
|
+
// Тонкие чёткие линии как у линейной сетки: alignment = 0.5
|
|
30
|
+
try {
|
|
31
|
+
g.lineStyle({ width: Math.max(0.5, this.crossLineWidth), color: this.color, alpha: 1, alignment: 0.5 });
|
|
32
|
+
} catch (_) {
|
|
33
|
+
g.lineStyle(Math.max(0.5, this.crossLineWidth), this.color, 1);
|
|
34
|
+
}
|
|
29
35
|
|
|
30
36
|
const hs = this.crossHalfSize;
|
|
31
37
|
|
|
32
38
|
for (let x = 0; x <= this.width; x += this.size) {
|
|
33
39
|
for (let y = 0; y <= this.height; y += this.size) {
|
|
40
|
+
// Выравниваем к полу-пикселю для чётких 1px линий
|
|
41
|
+
const px = Math.round(x) + 0.5;
|
|
42
|
+
const py = Math.round(y) + 0.5;
|
|
34
43
|
// Горизонтальная часть креста
|
|
35
|
-
g.moveTo(
|
|
36
|
-
g.lineTo(
|
|
44
|
+
g.moveTo(px - hs, py);
|
|
45
|
+
g.lineTo(px + hs, py);
|
|
37
46
|
// Вертикальная часть креста
|
|
38
|
-
g.moveTo(
|
|
39
|
-
g.lineTo(
|
|
47
|
+
g.moveTo(px, py - hs);
|
|
48
|
+
g.lineTo(px, py + hs);
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
}
|
package/src/grid/GridFactory.js
CHANGED
|
@@ -76,19 +76,19 @@ export class GridFactory {
|
|
|
76
76
|
},
|
|
77
77
|
dot: {
|
|
78
78
|
enabled: true,
|
|
79
|
-
size:
|
|
79
|
+
size: 30,
|
|
80
80
|
color: 0x6a6aff,
|
|
81
|
-
opacity: 0.
|
|
82
|
-
dotSize:
|
|
81
|
+
opacity: 0.7,
|
|
82
|
+
dotSize: 1,
|
|
83
83
|
dotStyle: 'circle',
|
|
84
84
|
highlightIntersections: true
|
|
85
85
|
},
|
|
86
86
|
cross: {
|
|
87
87
|
enabled: true,
|
|
88
|
-
size:
|
|
88
|
+
size: 90,
|
|
89
89
|
color: 0x6a6aff,
|
|
90
|
-
opacity: 0.
|
|
91
|
-
crossHalfSize:
|
|
90
|
+
opacity: 0.3,
|
|
91
|
+
crossHalfSize: 30,
|
|
92
92
|
crossLineWidth: 1
|
|
93
93
|
}
|
|
94
94
|
};
|