mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-11-05 06:03:24 +01:00
Fix unfilled text hit area
This commit is contained in:
parent
1b66fc21e0
commit
36a73c233e
@ -133,6 +133,7 @@ export default class BaseTool extends EventGroup {
|
|||||||
.filter(shapeData => {
|
.filter(shapeData => {
|
||||||
const shapeMatrix = shapeData.transform.multiplyMatrix(matrix);
|
const shapeMatrix = shapeData.transform.multiplyMatrix(matrix);
|
||||||
let shapePoints = shapeToPoints(shapeData);
|
let shapePoints = shapeToPoints(shapeData);
|
||||||
|
let { fill } = shapeData;
|
||||||
|
|
||||||
if (shapeData.type === 'TEXT') {
|
if (shapeData.type === 'TEXT') {
|
||||||
if (shapeData.text.text === '') return false;
|
if (shapeData.text.text === '') return false;
|
||||||
@ -143,14 +144,15 @@ export default class BaseTool extends EventGroup {
|
|||||||
new Vector(max.x, max.y),
|
new Vector(max.x, max.y),
|
||||||
new Vector(max.x, min.y)
|
new Vector(max.x, min.y)
|
||||||
], holes: [] }];
|
], holes: [] }];
|
||||||
|
fill = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isHit = shapePoints
|
const isHit = shapePoints
|
||||||
.some(({ points, holes }) => {
|
.some(({ points, holes }) => {
|
||||||
const shape = applyMatrixOnShape([points, ...holes], shapeMatrix);
|
const shape = applyMatrixOnShape([points, ...holes], shapeMatrix);
|
||||||
const clipperShape = new ClipperShape(shape, shapeData.fill, true, true);
|
const clipperShape = new ClipperShape(shape, fill, true, true);
|
||||||
|
|
||||||
if (shapeData.fill) {
|
if (fill) {
|
||||||
return clipperShape
|
return clipperShape
|
||||||
.fixOrientation()
|
.fixOrientation()
|
||||||
.pointInShape(position, true, true);
|
.pointInShape(position, true, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user