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
878e22b4
Commit
878e22b4
authored
Jun 19, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字体放大缩小
parent
5fdfcec0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
7 deletions
+104
-7
TextElementOperate.vue
src/views/Editor/Canvas/Operate/TextElementOperate.vue
+0
-1
TextsizeHandler.vue
src/views/Editor/Canvas/Operate/TextsizeHandler.vue
+85
-0
useScaleElement.ts
src/views/Editor/Canvas/hooks/useScaleElement.ts
+17
-4
Index.vue
src/views/TeamCenter/Index.vue
+1
-1
Index.vue
src/views/UserCenter/Index.vue
+1
-1
No files found.
src/views/Editor/Canvas/Operate/TextElementOperate.vue
View file @
878e22b4
...
...
@@ -70,5 +70,4 @@ const scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)
const
{
textElementResizeHandlers
,
verticalTextElementResizeHandlers
,
borderLines
,
textElementTesizeHandlers
}
=
useCommonOperate
(
scaleWidth
,
scaleHeight
)
const
resizeHandlers
=
computed
(()
=>
props
.
elementInfo
.
vertical
?
verticalTextElementResizeHandlers
.
value
:
textElementResizeHandlers
.
value
)
const
tesizeHandlers
=
computed
(()
=>
props
.
elementInfo
.
vertical
?
textElementTesizeHandlers
.
value
:
textElementTesizeHandlers
.
value
)
console
.
log
(
textElementTesizeHandlers
.
value
,
'---------'
)
</
script
>
\ No newline at end of file
src/views/Editor/Canvas/Operate/TextsizeHandler.vue
0 → 100644
View file @
878e22b4
<
template
>
<div
:class=
"['resize-handler', rotateClassName, type]"
></div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
computed
}
from
'vue'
import
type
{
OperateResizeHandlers
}
from
'@/types/edit'
const
props
=
withDefaults
(
defineProps
<
{
type
?:
OperateResizeHandlers
rotate
?:
number
}
>
(),
{
rotate
:
0
,
})
const
rotateClassName
=
computed
(()
=>
{
const
prefix
=
'rotate-'
const
rotate
=
props
.
rotate
if
(
rotate
>
-
22.5
&&
rotate
<=
22.5
)
return
prefix
+
0
else
if
(
rotate
>
22.5
&&
rotate
<=
67.5
)
return
prefix
+
45
else
if
(
rotate
>
67.5
&&
rotate
<=
112.5
)
return
prefix
+
90
else
if
(
rotate
>
112.5
&&
rotate
<=
157.5
)
return
prefix
+
135
else
if
(
rotate
>
157.5
||
rotate
<=
-
157.5
)
return
prefix
+
0
else
if
(
rotate
>
-
157.5
&&
rotate
<=
-
112.5
)
return
prefix
+
45
else
if
(
rotate
>
-
112.5
&&
rotate
<=
-
67.5
)
return
prefix
+
90
else
if
(
rotate
>
-
67.5
&&
rotate
<=
-
22.5
)
return
prefix
+
135
return
prefix
+
0
})
</
script
>
<
style
lang=
"scss"
scoped
>
.resize-handler
{
position
:
absolute
;
width
:
10px
;
height
:
10px
;
left
:
0
;
top
:
0
;
margin
:
-5px
0
0
-5px
;
border
:
1px
solid
$themeColor
;
background-color
:
#fff
;
border-radius
:
1px
;
cursor
:
pointer
;
&
.left-top.rotate-0
,
&
.right-bottom.rotate-0
,
&
.left.rotate-45
,
&
.right.rotate-45
,
&
.left-bottom.rotate-90
,
&
.right-top.rotate-90
,
&
.top.rotate-135
,
&
.bottom.rotate-135
{
cursor
:
nwse-resize
;
}
&
.top.rotate-0
,
&
.bottom.rotate-0
,
&
.left-top.rotate-45
,
&
.right-bottom.rotate-45
,
&
.left.rotate-90
,
&
.right.rotate-90
,
&
.left-bottom.rotate-135
,
&
.right-top.rotate-135
{
cursor
:
ns-resize
;
}
&
.left-bottom.rotate-0
,
&
.right-top.rotate-0
,
&
.top.rotate-45
,
&
.bottom.rotate-45
,
&
.left-top.rotate-90
,
&
.right-bottom.rotate-90
,
&
.left.rotate-135
,
&
.right.rotate-135
{
cursor
:
nesw-resize
;
}
&
.left.rotate-0
,
&
.right.rotate-0
,
&
.left-bottom.rotate-45
,
&
.right-top.rotate-45
,
&
.top.rotate-90
,
&
.bottom.rotate-90
,
&
.left-top.rotate-135
,
&
.right-bottom.rotate-135
{
cursor
:
ew-resize
;
}
}
</
style
>
\ No newline at end of file
src/views/Editor/Canvas/hooks/useScaleElement.ts
View file @
878e22b4
import
type
{
Ref
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useMainStore
,
useSlidesStore
,
useKeyboardStore
}
from
'@/store'
import
{
useMainStore
,
useSlidesStore
,
useKeyboardStore
,
useFontStore
}
from
'@/store'
import
type
{
PPTElement
,
PPTImageElement
,
PPTLineElement
,
PPTShapeElement
}
from
'@/types/slides'
import
{
OperateResizeHandlers
,
type
AlignmentLineProps
,
type
MultiSelectRange
}
from
'@/types/edit'
import
{
VIEWPORT_SIZE
}
from
'@/configs/canvas'
...
...
@@ -8,6 +8,7 @@ import { MIN_SIZE } from '@/configs/element'
import
{
SHAPE_PATH_FORMULAS
}
from
'@/configs/shapes'
import
{
type
AlignLine
,
uniqAlignLines
}
from
'@/utils/element'
import
useHistorySnapshot
from
'@/hooks/useHistorySnapshot'
import
emitter
,
{
EmitterEvents
}
from
'@/utils/emitter'
interface
RotateElementData
{
left
:
number
...
...
@@ -100,13 +101,13 @@ export default (
)
=>
{
const
mainStore
=
useMainStore
()
const
slidesStore
=
useSlidesStore
()
const
{
activeElementIdList
,
activeGroupElementId
}
=
storeToRefs
(
mainStore
)
const
{
activeElementIdList
,
activeGroupElementId
,
richTextAttrs
}
=
storeToRefs
(
mainStore
)
const
{
viewportRatio
}
=
storeToRefs
(
slidesStore
)
const
{
ctrlOrShiftKeyActive
}
=
storeToRefs
(
useKeyboardStore
())
const
{
addHistorySnapshot
}
=
useHistorySnapshot
()
// 缩放元素
// 缩放
文字
元素
const
scaleText
=
(
e
:
MouseEvent
|
TouchEvent
,
element
:
Exclude
<
PPTElement
,
PPTLineElement
>
,
command
:
OperateResizeHandlers
)
=>
{
const
isTouchEvent
=
!
(
e
instanceof
MouseEvent
)
if
(
isTouchEvent
&&
(
!
e
.
changedTouches
||
!
e
.
changedTouches
[
0
]))
return
...
...
@@ -139,6 +140,11 @@ export default (
let
baseTop
=
0
let
horizontalLines
:
AlignLine
[]
=
[]
let
verticalLines
:
AlignLine
[]
=
[]
let
idData
=
''
let
oWidth
=
0
let
oHeight
=
0
let
nWidth
=
0
let
nHeight
=
0
// 旋转后的元素进行缩放时,引入基点的概念,以当前操作的缩放点相对的点为基点
// 例如拖动右下角缩放时,左上角为基点,需要保持左上角不变然后修改其他的点的位置来达到所放的效果
...
...
@@ -424,6 +430,9 @@ export default (
cellMinHeight
:
cellMinHeight
<
36
?
36
:
cellMinHeight
,
}
}
idData
=
el
.
id
oWidth
=
el
.
width
oHeight
=
el
.
height
return
{
...
el
,
left
,
top
,
width
,
height
}
})
}
...
...
@@ -443,10 +452,14 @@ export default (
if
(
startPageX
===
currentPageX
&&
startPageY
===
currentPageY
)
return
console
.
log
(
elementList
.
value
,
'-----'
)
slidesStore
.
updateSlide
({
elements
:
elementList
.
value
})
mainStore
.
setScalingState
(
false
)
let
textIdData
=
elementList
.
value
.
filter
(
x
=>
x
.
id
==
idData
)
let
el
=
textIdData
[
0
]
nWidth
=
el
.
width
nHeight
=
el
.
height
console
.
log
(
textIdData
[
0
],
'-----'
)
addHistorySnapshot
()
}
...
...
src/views/TeamCenter/Index.vue
View file @
878e22b4
...
...
@@ -55,7 +55,7 @@
<span
class=
"title"
>
存储空间
</span>
<div
class=
"text-small text-info q-mt-sm"
>
会员可以使用平台全部预设模板
</div>
</div>
<el-button
type=
"info"
class=
"normal"
>
会员尊享
{{
TravelDesign
.
CloudTot
sl
}}{{
TravelDesign
.
CloudTotall
nit
}}
空间
</el-button>
<el-button
type=
"info"
class=
"normal"
>
会员尊享
{{
TravelDesign
.
CloudTot
al
}}{{
TravelDesign
.
CloudTotalU
nit
}}
空间
</el-button>
</div>
<div
style=
"font-size: 14px;"
class=
"q-mt-xl"
>
<el-progress
:percentage=
"TravelDesign.storagePercent"
/>
...
...
src/views/UserCenter/Index.vue
View file @
878e22b4
...
...
@@ -59,7 +59,7 @@
<span
class=
"title"
>
存储空间
</span>
<div
class=
"text-small text-info q-mt-sm"
>
会员可以使用平台全部预设模板
</div>
</div>
<el-button
type=
"info"
class=
"normal"
>
会员尊享{{TravelDesign.CloudTot
sl}}{{TravelDesign.CloudTotall
nit}}空间
</el-button>
<el-button
type=
"info"
class=
"normal"
>
会员尊享{{TravelDesign.CloudTot
al}}{{TravelDesign.CloudTotalU
nit}}空间
</el-button>
</div>
<div
style=
"font-size: 14px;"
class=
"q-mt-xl"
>
<el-progress
:percentage=
"TravelDesign.storagePercent"
/>
...
...
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