feat: Figma 式外壳与编辑器内核
布局改成 顶部工具栏 / 左图层 / 中画布 / 右属性 / 底部悬浮胶囊。 新内核: - 图层模型:fabric 对象是唯一真源,LayerInfo 是只读投影; id/名字/锁定挂在 customProperties 上,随 toJSON 持久化 - 视口:zoom/pan 走 viewportTransform,只影响显示; 导出改为按视口裁剪(artboardExportOptions),旧的「multiplier 恒为 1」 在画布铺满工作区之后不再成立 - 历史:快照式撤销重做,30 步上限,带重入保护 - 命令表:快捷键 / 右键菜单 / 工具栏三个入口共用一份注册表 键位取自 Penpot 快捷键表 - 画板用 backgroundImage 画(跟随视口且不进 getObjects) 两个 fabric 陷阱已在注释里记下: - Rect 默认原点是中心,left:0/top:0 不写 originX/originY 会画错位置 - canvas.clipPath 不吃 viewportTransform,不能用来裁画板
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 【T8 待实现 — 右侧属性检查器】
|
||||
*
|
||||
* 只放**选中对象的属性**,不再是原来那个什么都装的侧栏。分组:
|
||||
*
|
||||
* - 位置与尺寸:X / Y / W / H(W/H 是缩放后的实际占位尺寸,见 types.ts 的 TransformValues)
|
||||
* - 变换:缩放比例 X/Y、旋转角度
|
||||
* - 外观:不透明度、圆角(矩形走 rx/ry;图片靠 clipPath 挂圆角矩形;文字没有)
|
||||
*
|
||||
* 全部双向绑定:画布上拖动要让数字跟着变(watch `useEditor().revision`),
|
||||
* 改数字要立刻反映到画布(`obj.set` + `setCoords` + `requestRenderAll`)。
|
||||
* 每次编辑结束调 `commit()` 记一步历史;拖拽过程中不要每帧 commit。
|
||||
*
|
||||
* 没选中对象时显示画布本身的属性(尺寸、背景色)。
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<aside class="inspector">
|
||||
<h2>属性</h2>
|
||||
<p class="todo">T8 待实现:X / Y / W / H、缩放、旋转、不透明度、圆角</p>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.inspector {
|
||||
border-left: 1px solid var(--line);
|
||||
background: var(--bg2);
|
||||
overflow-y: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.inspector h2 {
|
||||
margin: 0 12px 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
color: var(--fg-dim);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.todo {
|
||||
color: var(--fg-dim);
|
||||
margin: 0 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user