Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador annotations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador annotations
Commits
fd5fafba
Commit
fd5fafba
authored
1 year ago
by
Samuel Jugnet
Browse files
Options
Downloads
Patches
Plain Diff
wip drawing
parent
c7671f50
Branches
Branches containing commit
No related tags found
1 merge request
!10
Draft: MigratingAnnotationCreation to MUI5.
Pipeline
#1709
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/AnnotationDrawing.js
+26
-17
26 additions, 17 deletions
src/AnnotationDrawing.js
with
26 additions
and
17 deletions
src/AnnotationDrawing.js
+
26
−
17
View file @
fd5fafba
...
@@ -33,22 +33,25 @@ class FreeHand extends React.Component {
...
@@ -33,22 +33,25 @@ class FreeHand extends React.Component {
};
};
render
()
{
render
()
{
const
{
activeTool
}
=
this
.
props
;
const
{
activeTool
,
points
,
fill
}
=
this
.
props
;
const
isSelected
=
this
.
props
.
selected
const
isSelected
=
this
.
props
.
selected
// will be a custom shape
// will be a custom shape
return
(
return
(
<
React
.
Fragment
>
<
React
.
Fragment
>
<
Shape
<
Shape
ref
=
{
this
.
shapeRef
}
ref
=
{
this
.
shapeRef
}
x
=
{
this
.
props
.
x
||
10
0
}
x
=
{
0
}
y
=
{
this
.
props
.
y
||
10
0
}
y
=
{
0
}
width
=
{
this
.
props
.
width
||
1920
}
width
=
{
this
.
props
.
width
||
1920
}
height
=
{
this
.
props
.
height
||
1080
}
height
=
{
this
.
props
.
height
||
1080
}
points
=
{
this
.
props
.
points
||
[
0
,
0
,
100
,
0
,
100
,
100
]}
fill
=
{
this
.
props
.
fill
||
'
red
'
}
fill
=
{
this
.
props
.
fill
||
'
red
'
}
stroke
=
{
this
.
props
.
stroke
||
'
black
'
}
stroke
=
{
this
.
props
.
stroke
||
'
black
'
}
strokeWidth
=
{
this
.
props
.
strokeWidth
||
1
}
strokeWidth
=
{
this
.
props
.
strokeWidth
||
1
}
...
@@ -56,22 +59,28 @@ class FreeHand extends React.Component {
...
@@ -56,22 +59,28 @@ class FreeHand extends React.Component {
draggable
=
{
activeTool
===
'
cursor
'
||
activeTool
===
'
edit
'
}
draggable
=
{
activeTool
===
'
cursor
'
||
activeTool
===
'
edit
'
}
onClick
=
{
this
.
handleClick
}
onClick
=
{
this
.
handleClick
}
sceneFunc
=
{(
context
,
shape
)
=>
{
sceneFunc
=
{(
context
,
shape
)
=>
{
console
.
log
(
'
scene func
'
);
console
.
log
(
'
scene func
'
,
points
);
// context.beginPath();
// for (let i = 0; i < shape.points.length; i += 2) {
for
(
let
i
=
0
;
i
<
points
.
length
;
i
+=
2
)
{
// const x = shape.points[i];
// const y = shape.points[i + 1];
// context.lineTo(x, y);
// }
// context.fillStyle = shape.fill;
// context.fillStrokeShape(shape);
context
.
beginPath
();
context
.
beginPath
();
context
.
moveTo
(
20
,
50
);
//draw rect for each point
context
.
lineTo
(
220
,
80
);
context
.
quadraticCurveTo
(
150
,
100
,
260
,
170
);
context
.
rect
(
points
[
i
]
-
2.5
,
points
[
i
+
1
]
-
2.5
,
5
,
5
);
// fill rect with color
context
.
closePath
();
context
.
closePath
();
// (!) Konva specific method, it is very important
context
.
fillStrokeShape
(
shape
);
context
.
fillStrokeShape
(
shape
);
}
// context.beginPath();
// context.moveTo(20, 50);
// context.lineTo(220, 80);
// context.quadraticCurveTo(150, 100, 260, 170);
// context.closePath();
// // (!) Konva specific method, it is very important
// context.fillStrokeShape(shape);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment