Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gojs
Overview
Overview
Details
Activity
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
吴斌
vue-gojs
Commits
51f1dfe8
Commit
51f1dfe8
authored
Oct 19, 2023
by
吴斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:调整大小时,shape 和 geometry 类型节点边框会部分消失的问题。
parent
042f7692
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
NodeTemplateKit.ts
src/kit/NodeTemplateKit.ts
+4
-5
No files found.
src/kit/NodeTemplateKit.ts
View file @
51f1dfe8
...
...
@@ -6,7 +6,7 @@ import go from "gojs";
// 源节点的模板--type: svg
export
function
makeSVGNode
(
size
:
number
)
{
return
GO
(
go
.
Picture
,
{
width
:
size
,
height
:
size
,
imageStretch
:
go
.
GraphObject
.
Fill
},
{
name
:
"view"
,
width
:
size
,
height
:
size
,
imageStretch
:
go
.
GraphObject
.
Fill
},
new
go
.
Binding
(
"source"
,
"img"
),
new
go
.
Binding
(
'desiredSize'
,
"size"
,
go
.
Size
.
parse
),
)
...
...
@@ -15,7 +15,7 @@ export function makeSVGNode (size:number) {
// 源节点的模板--type: geometry
export
function
makeGeometryNode
(
size
:
number
)
{
return
GO
(
go
.
Shape
,
{
width
:
size
,
height
:
size
,
geometryStretch
:
go
.
GraphObject
.
Fill
},
{
name
:
"view"
,
width
:
size
,
height
:
size
,
geometryStretch
:
go
.
GraphObject
.
Fill
},
new
go
.
Binding
(
"geometryString"
,
"geometry"
),
new
go
.
Binding
(
"fill"
,
"fill"
),
new
go
.
Binding
(
"stroke"
,
"stroke"
),
...
...
@@ -26,11 +26,10 @@ export function makeGeometryNode(size:number) {
// 源节点的模板--type: shape
export
function
makeShapeNode
(
size
:
number
){
return
GO
(
go
.
Shape
,
{
width
:
size
,
height
:
size
,
geometryStretch
:
go
.
GraphObject
.
Fill
},
{
name
:
"view"
,
width
:
size
,
height
:
size
,
geometryStretch
:
go
.
GraphObject
.
Fill
},
new
go
.
Binding
(
"figure"
,
"shape"
),
new
go
.
Binding
(
"fill"
,
"fill"
),
new
go
.
Binding
(
"stroke"
,
"stroke"
),
// todo 边框会失效
new
go
.
Binding
(
'desiredSize'
,
"size"
,
go
.
Size
.
parse
),
)
}
...
...
@@ -57,7 +56,7 @@ export function makeNodeTemplate(type:string, size:number){
export
function
makeDiagramNodeTemplate
(
type
:
string
,
size
:
number
){
return
GO
(
go
.
Node
,
"Spot"
,
{
selectable
:
true
,
selectionAdornmentTemplate
:
nodeSelectionAdornment
},
{
resizable
:
true
,
resizeAdornmentTemplate
:
nodeResizeAdornment
},
{
resizable
:
true
,
resizeAdornmentTemplate
:
nodeResizeAdornment
,
resizeObjectName
:
"view"
},
{
rotatable
:
true
,
rotateAdornmentTemplate
:
nodeRotateAdornment
,
locationSpot
:
go
.
Spot
.
Center
},
{
itemTemplate
:
nodePortTemplate
},
new
go
.
Binding
(
'location'
,
"loc"
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
),
...
...
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