Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
104fd92e
Commit
104fd92e
authored
Jun 19, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
878e22b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
27 deletions
+20
-27
useScaleElement.ts
src/views/Editor/Canvas/hooks/useScaleElement.ts
+20
-27
No files found.
src/views/Editor/Canvas/hooks/useScaleElement.ts
View file @
104fd92e
...
@@ -381,28 +381,6 @@ export default (
...
@@ -381,28 +381,6 @@ export default (
height
=
getSizeWithinRange
(
elOriginHeight
-
moveY
)
height
=
getSizeWithinRange
(
elOriginHeight
-
moveY
)
top
=
elOriginTop
-
(
height
-
elOriginHeight
)
top
=
elOriginTop
-
(
height
-
elOriginHeight
)
}
}
else
if
(
command
===
OperateResizeHandlers
.
LEFT
)
{
const
{
offsetX
}
=
alignedAdsorption
(
elOriginLeft
+
moveX
,
null
)
moveX
=
moveX
-
offsetX
width
=
getSizeWithinRange
(
elOriginWidth
-
moveX
)
left
=
elOriginLeft
-
(
width
-
elOriginWidth
)
}
else
if
(
command
===
OperateResizeHandlers
.
RIGHT
)
{
const
{
offsetX
}
=
alignedAdsorption
(
elOriginLeft
+
elOriginWidth
+
moveX
,
null
)
moveX
=
moveX
-
offsetX
width
=
getSizeWithinRange
(
elOriginWidth
+
moveX
)
}
else
if
(
command
===
OperateResizeHandlers
.
TOP
)
{
const
{
offsetY
}
=
alignedAdsorption
(
null
,
elOriginTop
+
moveY
)
moveY
=
moveY
-
offsetY
height
=
getSizeWithinRange
(
elOriginHeight
-
moveY
)
top
=
elOriginTop
-
(
height
-
elOriginHeight
)
}
else
if
(
command
===
OperateResizeHandlers
.
BOTTOM
)
{
const
{
offsetY
}
=
alignedAdsorption
(
null
,
elOriginTop
+
elOriginHeight
+
moveY
)
moveY
=
moveY
-
offsetY
height
=
getSizeWithinRange
(
elOriginHeight
+
moveY
)
}
}
}
elementList
.
value
=
elementList
.
value
.
map
(
el
=>
{
elementList
.
value
=
elementList
.
value
.
map
(
el
=>
{
...
@@ -433,7 +411,8 @@ export default (
...
@@ -433,7 +411,8 @@ export default (
idData
=
el
.
id
idData
=
el
.
id
oWidth
=
el
.
width
oWidth
=
el
.
width
oHeight
=
el
.
height
oHeight
=
el
.
height
return
{
...
el
,
left
,
top
,
width
,
height
}
console
.
log
(
oHeight
,
'------'
)
return
{
...
el
,
left
,
top
,
width
,
height
,
fontSize
:
2
}
})
})
}
}
...
@@ -452,14 +431,28 @@ export default (
...
@@ -452,14 +431,28 @@ export default (
if
(
startPageX
===
currentPageX
&&
startPageY
===
currentPageY
)
return
if
(
startPageX
===
currentPageX
&&
startPageY
===
currentPageY
)
return
slidesStore
.
updateSlide
({
elements
:
elementList
.
value
})
let
richTextAttr
=
richTextAttrs
.
value
.
fontsize
.
split
(
'px'
)
mainStore
.
setScalingState
(
false
)
let
baseFontSize
=
Number
(
richTextAttr
[
0
])
let
textIdData
=
elementList
.
value
.
filter
(
x
=>
x
.
id
==
idData
)
let
textIdData
=
elementList
.
value
.
filter
(
x
=>
x
.
id
==
idData
)
let
el
=
textIdData
[
0
]
let
el
=
textIdData
[
0
]
nWidth
=
el
.
width
nWidth
=
el
.
width
nHeight
=
el
.
height
nHeight
=
el
.
height
console
.
log
(
textIdData
[
0
],
'-----'
)
const
fontSizeW
=
Math
.
round
(
nWidth
/
100
*
baseFontSize
);
const
fontSizeH
=
Math
.
round
(
nHeight
/
100
*
parseInt
(
baseFontSize
));
let
value
=
fontSizeH
+
'px'
console
.
log
(
value
,
'111---'
)
let
command
=
'fontsize'
// useFontStore().loadFontToDocument([value])
// emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })
slidesStore
.
updateSlide
({
elements
:
elementList
.
value
})
mainStore
.
setScalingState
(
false
)
addHistorySnapshot
()
addHistorySnapshot
()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment