Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
digilib-pivaj
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel ANTELME
digilib-pivaj
Commits
6caf1ca6
Commit
6caf1ca6
authored
10 years ago
by
hertzhaft
Browse files
Options
Downloads
Patches
Plain Diff
immediate reaction on when dragging and keys x or y are pressed
parent
7f9b4689
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webapp/src/main/webapp/jquery/jquery.digilib.measure.js
+15
-1
15 additions, 1 deletion
webapp/src/main/webapp/jquery/jquery.digilib.measure.js
webapp/src/main/webapp/jquery/jquery.digilib.vector.js
+2
-2
2 additions, 2 deletions
webapp/src/main/webapp/jquery/jquery.digilib.vector.js
with
17 additions
and
3 deletions
webapp/src/main/webapp/jquery/jquery.digilib.measure.js
+
15
−
1
View file @
6caf1ca6
...
...
@@ -45,6 +45,8 @@
var
geom
=
null
;
// convenience variable, set in init()
var
CSS
=
''
;
// shape currently being drawn/dragged
var
currentShape
;
// current key state: keystate[event.key] = event
var
keystate
=
{};
// shiftPressed = event.shiftKey;
...
...
@@ -815,6 +817,7 @@
// event handler for positionShape
var
onPositionShape
=
function
(
event
,
shape
)
{
var
data
=
this
;
currentShape
=
shape
;
if
(
keystate
[
'
x
'
]
!=
null
)
{
// change only x-Dimension of mouse pointer
manipulatePosition
(
shape
,
lockDimension
(
'
y
'
));
}
...
...
@@ -835,6 +838,7 @@
var
onChangeShape
=
function
(
event
,
shape
)
{
var
data
=
this
;
updateInfo
(
data
,
shape
);
currentShape
=
null
;
_debug_shape
(
'
onChangeShape
'
,
shape
);
};
...
...
@@ -1124,12 +1128,22 @@
var
onKeyDown
=
function
(
event
,
data
)
{
var
code
=
event
.
keyCode
;
var
key
=
event
.
key
;
keystate
[
key
]
=
event
;
// save key state on key
// delete selected shapes
if
(
code
===
46
||
key
===
'
Delete
'
)
{
removeSelectedShapes
(
data
);
return
false
;
}
keystate
[
key
]
=
event
;
// save key state on key
// keys 'x' and 'y': immediate response, lock dimension and redraw shape
if
(
code
===
88
||
key
===
'
x
'
||
code
===
89
||
key
===
'
y
'
)
{
if
(
currentShape
==
null
)
{
return
true
};
var
props
=
currentShape
.
properties
;
var
pt
=
props
.
screenpos
[
props
.
vtx
];
// get last recorded mouse position
var
eventpos
=
{
pageX
:
pt
.
x
,
pageY
:
pt
.
y
}
var
evt
=
jQuery
.
Event
(
"
mousemove.dlVertexDrag
"
,
eventpos
);
$
(
document
).
trigger
(
evt
);
}
// console.debug('measure: keyDown', code, event.key, keystate);
};
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/webapp/jquery/jquery.digilib.vector.js
+
2
−
2
View file @
6caf1ca6
...
...
@@ -470,7 +470,7 @@
delete
shape
.
$elem
;
}
};
/**
* return a vertexDragHandler function.
*
...
...
@@ -508,9 +508,9 @@
var
dragMove
=
function
(
evt
)
{
// dragging
var
pt
=
geom
.
position
(
evt
);
pt
.
clipTo
(
imgRect
);
shape
.
properties
.
screenpos
[
vtx
]
=
pt
;
$
(
data
).
trigger
(
'
positionShape
'
,
shape
);
pt
.
clipTo
(
imgRect
);
// move handle
$handle
.
attr
({
'
x
'
:
pt
.
x
-
hs
/
2
,
'
y
'
:
pt
.
y
-
hs
/
2
});
// update shape SVG element
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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