feat: 裁剪组裁剪跟随选择组移动

This commit is contained in:
bighuixiang
2025-07-14 01:00:23 +08:00
parent 96e13cb22a
commit 24e9ba8ae5
80 changed files with 2052 additions and 4292 deletions

View File

@@ -261,10 +261,7 @@ const actions = {
}
// 如果有当前笔刷实例且有更新方法,则调用
if (
state.currentBrushInstance &&
state.currentBrushInstance.updateProperty
) {
if (state.currentBrushInstance && state.currentBrushInstance.updateProperty) {
state.currentBrushInstance.updateProperty(propId, value);
}
},
@@ -277,7 +274,7 @@ const actions = {
*/
getPropertyValue(propId, defaultValue) {
// 检查属性值是否存在
if (state.propertyValues.hasOwnProperty(propId)) {
if (Object.prototype.hasOwnProperty.call(state.propertyValues, propId)) {
return state.propertyValues[propId];
}
@@ -551,10 +548,7 @@ const actions = {
// 导入材质预设
if (config.texturePresets && Array.isArray(config.texturePresets)) {
state.texturePresets = [
...state.texturePresets,
...config.texturePresets,
];
state.texturePresets = [...state.texturePresets, ...config.texturePresets];
}
// 导入自定义材质
@@ -580,9 +574,7 @@ const actions = {
state.texturePresets.forEach((preset, index) => {
const texture = texturePresetManager.getTextureById(preset.textureId);
if (!texture) {
console.warn(
`材质预设 "${preset.name}" 引用的材质 ${preset.textureId} 不存在`
);
console.warn(`材质预设 "${preset.name}" 引用的材质 ${preset.textureId} 不存在`);
// 可以选择使用默认材质替换或删除该预设
if (texturePresetManager.getAllTextures().length > 0) {
preset.textureId = texturePresetManager.getAllTextures()[0].id;
@@ -654,9 +646,7 @@ export const BrushStore = {
* @returns {Object} {r, g, b, a} 颜色值对象
*/
parseRGBAColor(rgbaColor) {
const rgbaMatch = rgbaColor.match(
/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/
);
const rgbaMatch = rgbaColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
if (rgbaMatch) {
return {
r: parseInt(rgbaMatch[1]),