파워콘 작업

This commit is contained in:
yjnoh 2024-08-09 17:28:28 +09:00
parent dcff818c56
commit ddb0d36e74

View File

@ -501,10 +501,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
const allPointsInside = rectPoints.every((point) => this.inPolygonABType(point.x, point.y, points)) const allPointsInside = rectPoints.every((point) => this.inPolygonABType(point.x, point.y, points))
if (allPointsInside) { if (allPointsInside) {
const text = new fabric.Text(`col ${i}, row ${j}`, { //먼저 그룹화를 시켜놓고 뒤에서 글씨를 넣어서 변경한다
const text = new fabric.Text(``, {
fontFamily: 'serif', fontFamily: 'serif',
fontSize: 10, fontSize: 30,
fill: 'black', fill: 'black',
type: 'cellText',
}) })
const rect = new fabric.Rect({ const rect = new fabric.Rect({
@ -523,6 +525,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
opacity: 0.8, opacity: 0.8,
name: 'cell', name: 'cell',
idx: idx, idx: idx,
type: 'cellRect',
}) })
var group = new fabric.Group([rect, text], { var group = new fabric.Group([rect, text], {