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
63b2a589
Commit
63b2a589
authored
Jun 21, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字体放大缩小
parent
8b16992b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
useScaleElement.ts
src/views/Editor/Canvas/hooks/useScaleElement.ts
+19
-7
No files found.
src/views/Editor/Canvas/hooks/useScaleElement.ts
View file @
63b2a589
import
{
fa
}
from
'element-plus/es/locale'
;
import
type
{
Ref
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useMainStore
,
useSlidesStore
,
useKeyboardStore
,
useFontStore
}
from
'@/store'
...
...
@@ -404,29 +405,40 @@ export default (
}
}
let
baseFontSize
=
0
let
baseFontSize
=
0
let
aaa
=
'<p style=""><span style="font-size: 97.62px;">日本旅游</span></p>'
// let arr = aaa.split(';')
let
arr
=
el
.
content
.
split
(
';'
)
// console.log(el.content)
// console.log(arr,'====1111')
let
fontSize
=
arr
.
filter
((
z
:
any
)
=>
z
.
indexOf
(
'font-size:'
)
!=-
1
)
if
(
fontSize
.
length
>
0
){
if
(
fontSize
&&
fontSize
.
length
>
0
){
let
arrs
=
fontSize
[
0
].
split
(
':'
)
let
arrs2
=
arrs
[
1
].
split
(
'px'
)
baseFontSize
=
Number
(
arrs2
[
0
])
}
const
w
=
parseInt
(
Number
(
el
.
width
)
-
Number
(
width
))
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
){
if
(
arr
[
i
].
indexOf
(
'font-size:'
)
!=-
1
){
if
(
(
el
.
width
-
width
)
>
2
||
(
el
.
width
-
width
)
<-
2
){
if
(
(
el
.
width
-
width
)
>
1
)
baseFontSize
--
if
(
w
>
2
||
w
<-
2
){
if
(
w
>
2
)
baseFontSize
--
else
baseFontSize
++
arr
[
i
]
=
`font-size:
${
baseFontSize
}
px`
arr
[
i
]
=
`font-size:
${
baseFontSize
}
px`
}
}
}
}
let
content
=
''
const
last
=
arr
.
length
-
1
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
){
if
(
i
<
arr
.
length
-
1
){
console
.
log
(
arr
[
i
],
`----
${
i
}
---1111`
)
if
(
i
!=
last
){
content
+=
arr
[
i
]
+
';'
}
else
content
+=
arr
[
i
]
}
console
.
log
(
arr
)
console
.
log
(
content
,
'-0-----'
)
return
{
...
el
,
left
,
top
,
width
,
height
,
content
}
})
}
...
...
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