mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
refactor: update style and dashboard cell max
This commit is contained in:
@@ -251,7 +251,9 @@ function removeItemFromPositionBox(item: CanvasItem) {
|
||||
*/
|
||||
function recomputeCellWidth() {
|
||||
if (!containerRef.value) return
|
||||
maxCell.value = Math.round(containerRef.value.offsetWidth / cellWidth.value)
|
||||
maxCell.value = isMainCanvas(props.canvasId)
|
||||
? Math.floor(containerRef.value.offsetWidth / cellWidth.value)
|
||||
: Math.round(containerRef.value.offsetWidth / cellWidth.value)
|
||||
}
|
||||
|
||||
function sizeInit() {
|
||||
@@ -918,6 +920,8 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
|
||||
),
|
||||
1
|
||||
)
|
||||
// temp adjust board
|
||||
|
||||
// Adjust the accuracy of moving coordinate changes
|
||||
const newY = Math.max(
|
||||
Math.floor(
|
||||
|
||||
@@ -66,12 +66,12 @@ const canvasSizeInit = () => {
|
||||
|
||||
const sizeInit = () => {
|
||||
if (dashboardEditorRef.value) {
|
||||
baseMarginLeft.value = 16
|
||||
baseMarginTop.value = 16
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
const screenWidth = dashboardEditorRef.value.offsetWidth
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
const screenHeight = dashboardEditorRef.value.offsetHeight
|
||||
baseMarginLeft.value = 10
|
||||
baseMarginTop.value = 10
|
||||
baseWidth.value =
|
||||
(screenWidth - baseMarginLeft.value) / props.baseMatrixCount.x - baseMarginLeft.value
|
||||
baseHeight.value =
|
||||
|
||||
@@ -91,7 +91,7 @@ const baseParams = computed(() => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.editor-content {
|
||||
padding: 12px;
|
||||
padding: 8px;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
|
||||
Reference in New Issue
Block a user