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
3a7681b8
Commit
3a7681b8
authored
1 year ago
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Fix import
parent
95bda4aa
No related branches found
No related tags found
1 merge request
!10
Draft: MigratingAnnotationCreation to MUI5.
Pipeline
#1848
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/annotationForm/AnnotationFormDrawing.js
+11
-16
11 additions, 16 deletions
src/annotationForm/AnnotationFormDrawing.js
with
11 additions
and
16 deletions
src/annotationForm/AnnotationFormDrawing.js
+
11
−
16
View file @
3a7681b8
...
...
@@ -10,9 +10,8 @@ import ArrowOutwardIcon from '@mui/icons-material/ArrowOutward';
import
RectangleIcon
from
'
@mui/icons-material/CheckBoxOutlineBlank
'
;
import
CircleIcon
from
'
@mui/icons-material/RadioButtonUnchecked
'
;
import
PolygonIcon
from
'
@mui/icons-material/Timeline
'
;
import
DeleteIcon
from
'
@mui/icons-material/Delete
'
;
import
GestureIcon
from
'
@mui/icons-material/Gesture
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
ToggleButtonGroup
from
'
@mui/material/ToggleButtonGroup
'
;
import
StrokeColorIcon
from
'
@mui/icons-material/BorderColor
'
;
import
ArrowDropDownIcon
from
'
@mui/icons-material/ArrowDropDown
'
;
...
...
@@ -28,7 +27,6 @@ import { v4 as uuidv4 } from 'uuid';
import
CategoryIcon
from
'
@mui/icons-material/Category
'
;
import
CursorIcon
from
'
../icons/Cursor
'
;
import
ImageFormField
from
'
./ImageFormField
'
;
import
{
fill
}
from
'
lodash
'
;
const
StyledToggleButtonGroup
=
styled
(
ToggleButtonGroup
)(({
theme
})
=>
({
'
&:first-of-type
'
:
{
...
...
@@ -55,28 +53,25 @@ const StyledDivButtonImage = styled('div')(({ theme }) => ({
marginTop
:
'
5px
'
,
}));
const
rgbaToObj
=
(
rgba
=
'
rgba(255,255,255,0.5)
'
)
=>
{
const
rgbaArray
=
rgba
.
split
(
'
,
'
);
const
r
=
Number
(
rgbaArray
[
0
].
split
(
'
(
'
)[
1
]);
const
g
=
Number
(
rgbaArray
[
1
]);
const
b
=
Number
(
rgbaArray
[
2
]);
const
a
=
Number
(
rgbaArray
[
3
].
split
(
'
)
'
)[
0
]);
return
{
r
,
g
,
b
,
a
};
}
return
{
// eslint-disable-next-line sort-keys
r
,
g
,
b
,
a
,
};
};
const
objToRgba
=
(
obj
=
{
r
:
255
,
g
:
255
,
b
:
255
,
a
:
0.5
})
=>
{
return
`rgba(
${
obj
.
r
}
,
${
obj
.
g
}
,
${
obj
.
b
}
,
${
obj
.
a
}
)`
;
}
const
objToRgba
=
(
obj
=
{
// eslint-disable-next-line sort-keys
r
:
255
,
g
:
255
,
b
:
255
,
a
:
0.5
,
})
=>
`rgba(
${
obj
.
r
}
,
${
obj
.
g
}
,
${
obj
.
b
}
,
${
obj
.
a
}
)`
;
/** All the stuff to manage to choose the drawing tool */
function
AnnotationFormDrawing
({
updateToolState
,
toolState
,
handleImgChange
})
{
useEffect
(()
=>
{
},
[
toolState
.
fillColor
,
toolState
.
strokeColor
,
toolState
.
strokeWidth
]);
...
...
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