Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Signature Frontend
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Electronic Signature Service
Signature Frontend
Commits
5345e638
Commit
5345e638
authored
5 years ago
by
Reiter, Christoph
Browse files
Options
Downloads
Patches
Plain Diff
Rotate signature block around the center
Fixes
#24
parent
7cfcac7a
No related branches found
No related tags found
No related merge requests found
Pipeline
#11841
passed with warnings
5 years ago
Stage: test
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/vpu-pdf-preview.js
+3
-8
3 additions, 8 deletions
src/vpu-pdf-preview.js
with
3 additions
and
8 deletions
src/vpu-pdf-preview.js
+
3
−
8
View file @
5345e638
...
@@ -109,7 +109,7 @@ export class PdfPreview extends ScopedElementsMixin(VPULitElement) {
...
@@ -109,7 +109,7 @@ export class PdfPreview extends ScopedElementsMixin(VPULitElement) {
// add signature image
// add signature image
fabric
.
Image
.
fromURL
(
this
.
placeholder
,
function
(
image
)
{
fabric
.
Image
.
fromURL
(
this
.
placeholder
,
function
(
image
)
{
// add a red border around the signature placeholder
// add a red border around the signature placeholder
image
.
set
({
stroke
:
"
#e4154b
"
,
strokeWidth
:
that
.
border_width
,
strokeUniform
:
true
});
image
.
set
({
stroke
:
"
#e4154b
"
,
strokeWidth
:
that
.
border_width
,
strokeUniform
:
true
,
centeredRotation
:
true
});
// disable controls, we currently don't want resizing and do rotation with a button
// disable controls, we currently don't want resizing and do rotation with a button
image
.
hasControls
=
false
;
image
.
hasControls
=
false
;
...
@@ -400,13 +400,8 @@ export class PdfPreview extends ScopedElementsMixin(VPULitElement) {
...
@@ -400,13 +400,8 @@ export class PdfPreview extends ScopedElementsMixin(VPULitElement) {
*/
*/
async
rotateSignature
()
{
async
rotateSignature
()
{
let
signature
=
this
.
getSignatureRect
();
let
signature
=
this
.
getSignatureRect
();
let
angel
=
signature
.
get
(
"
angle
"
)
+
90
;
let
angle
=
(
signature
.
get
(
"
angle
"
)
+
90
)
%
360
;
signature
.
rotate
(
angle
);
if
(
angel
>=
360
)
{
angel
=
0
;
}
signature
.
set
({
angle
:
angel
});
signature
.
setCoords
();
signature
.
setCoords
();
this
.
enforceCanvasBoundaries
(
signature
);
this
.
enforceCanvasBoundaries
(
signature
);
...
...
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