feat: add background fill functionality for layers
- Implemented FillLayerBackgroundCommand to fill the background of layers with a specified color. - Introduced BackgroundFillManager to manage background fill operations. - Updated LayerManager to include fillLayerBackground method. - Enhanced LayersPanel with a color picker for filling layer backgrounds. - Modified RasterizeLayerCommand to reflect changes in terminology and functionality. - Adjusted LayerSort to ensure filled layers are rendered at the correct z-index. - Updated relevant utility functions and components to support new fill feature.
This commit is contained in:
@@ -206,6 +206,16 @@ export class UpdateGroupMaskPositionCommand extends Command {
|
||||
}
|
||||
});
|
||||
|
||||
if (layer?.fill) {
|
||||
// 更新组图层的填充颜色
|
||||
const fabricObject = this.canvas.getObjects().find((o) => o.id === layer?.fill.id);
|
||||
if (fabricObject) {
|
||||
fabricObject.clipPath = clippingMaskFabricObject;
|
||||
fabricObject.dirty = true;
|
||||
fabricObject.setCoords();
|
||||
}
|
||||
}
|
||||
|
||||
if (isUndo) {
|
||||
this.activeSelection.set({
|
||||
left: this.originalSelectionPosition.left - this.deltaX,
|
||||
|
||||
Reference in New Issue
Block a user