Skip to content

Commit 4fd6015

Browse files
committed
refactor: update style and dashboard cell max
1 parent 8156d6d commit 4fd6015

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

frontend/src/views/dashboard/canvas/CanvasCore.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ function removeItemFromPositionBox(item: CanvasItem) {
251251
*/
252252
function recomputeCellWidth() {
253253
if (!containerRef.value) return
254-
maxCell.value = Math.round(containerRef.value.offsetWidth / cellWidth.value)
254+
maxCell.value = isMainCanvas(props.canvasId)
255+
? Math.floor(containerRef.value.offsetWidth / cellWidth.value)
256+
: Math.round(containerRef.value.offsetWidth / cellWidth.value)
255257
}
256258
257259
function sizeInit() {
@@ -918,6 +920,8 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
918920
),
919921
1
920922
)
923+
// temp adjust board
924+
921925
// Adjust the accuracy of moving coordinate changes
922926
const newY = Math.max(
923927
Math.floor(

frontend/src/views/dashboard/editor/DashboardEditor.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ const canvasSizeInit = () => {
6666
6767
const sizeInit = () => {
6868
if (dashboardEditorRef.value) {
69+
baseMarginLeft.value = 16
70+
baseMarginTop.value = 16
6971
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
7072
const screenWidth = dashboardEditorRef.value.offsetWidth
7173
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
7274
const screenHeight = dashboardEditorRef.value.offsetHeight
73-
baseMarginLeft.value = 10
74-
baseMarginTop.value = 10
7575
baseWidth.value =
7676
(screenWidth - baseMarginLeft.value) / props.baseMatrixCount.x - baseMarginLeft.value
7777
baseHeight.value =

frontend/src/views/dashboard/editor/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const baseParams = computed(() => {
9191

9292
<style scoped lang="less">
9393
.editor-content {
94-
padding: 12px;
94+
padding: 8px;
9595
width: 100vw;
9696
height: 100vh;
9797
background: #fff;

0 commit comments

Comments
 (0)