Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
medsurf-draw
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
medsurf-draw
Commits
8d0ed753
Commit
8d0ed753
authored
2 years ago
by
Andrea Gottsponer
Browse files
Options
Downloads
Patches
Plain Diff
- fix image pan for hole scene
parent
ac4bc784
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
package.json
+1
-1
1 addition, 1 deletion
package.json
src/app/index.ts
+1
-0
1 addition, 0 deletions
src/app/index.ts
src/lib/elements/images/Image.ts
+35
-16
35 additions, 16 deletions
src/lib/elements/images/Image.ts
with
37 additions
and
17 deletions
package.json
+
1
−
1
View file @
8d0ed753
{
"name"
:
"medsurf-draw"
,
"version"
:
"1.0.21
7
"
,
"version"
:
"1.0.2
2
1"
,
"description"
:
"Draw annotations on jpg/zoomify images, based on PIXI.js"
,
"keywords"
:
[
"draw"
,
...
...
This diff is collapsed.
Click to expand it.
src/app/index.ts
+
1
−
0
View file @
8d0ed753
...
...
@@ -1088,6 +1088,7 @@ ready(() => {
fontVariant
:
"
normal
"
,
fontWeight
:
"
900
"
});
cursor
.
name
=
"
cursor
"
;
cursor
.
visible
=
false
;
app
.
stage
.
addChild
(
cursor
);
...
...
This diff is collapsed.
Click to expand it.
src/lib/elements/images/Image.ts
+
35
−
16
View file @
8d0ed753
...
...
@@ -183,7 +183,9 @@ export class Image extends BaseContainer<ImageModel> {
this
.
contextInteraction
.
on
(
"
endRight
"
,
this
.
endRight
,
this
);
// -- Move interaction
this
.
moveInteraction
=
new
MedsurfDraw
.
MoveInteraction
(
this
,
true
);
this
.
moveInteraction
.
on
(
"
startMove
"
,
this
.
startMove
,
this
);
this
.
moveInteraction
.
on
(
"
onMove
"
,
this
.
onMove
,
this
);
this
.
moveInteraction
.
on
(
"
endMove
"
,
this
.
endMove
,
this
);
// -- Zoom interaction
this
.
zoomInteraction
=
new
MedsurfDraw
.
ZoomInteraction
(
this
);
this
.
zoomInteraction
.
on
(
"
onZoom
"
,
this
.
onZoom
,
this
);
...
...
@@ -204,9 +206,10 @@ export class Image extends BaseContainer<ImageModel> {
// -- Resize
parent
.
on
(
"
resize
"
,
this
.
onResize
,
this
);
// -- Move
this
.
on
(
"
mousedown
"
,
this
.
moveInteraction
.
startMove
,
this
.
moveInteraction
);
this
.
on
(
"
pointermove
"
,
this
.
moveInteraction
.
onMove
,
this
.
moveInteraction
);
this
.
on
(
"
mouseup
"
,
this
.
moveInteraction
.
endMove
,
this
.
moveInteraction
);
parent
.
interactive
=
true
;
parent
.
on
(
"
mousedown
"
,
this
.
moveInteraction
.
startMove
,
this
.
moveInteraction
);
parent
.
on
(
"
pointermove
"
,
this
.
moveInteraction
.
onMove
,
this
.
moveInteraction
);
parent
.
on
(
"
mouseup
"
,
this
.
moveInteraction
.
endMove
,
this
.
moveInteraction
);
// -- Debounce
this
.
on
(
"
debouncedUnselectLayerGroup
"
,
this
.
_debounceUndelectLayerGroupMethod
);
this
.
on
(
"
debouncedUnselectGrouping
"
,
this
.
_debounceUndelectGroupingMethod
);
...
...
@@ -219,9 +222,10 @@ export class Image extends BaseContainer<ImageModel> {
// -- Resize
parent
.
off
(
"
resize
"
,
this
.
onResize
,
this
);
// -- Move
this
.
off
(
"
mousedown
"
,
this
.
moveInteraction
.
startMove
,
this
.
moveInteraction
);
this
.
off
(
"
pointermove
"
,
this
.
moveInteraction
.
onMove
,
this
.
moveInteraction
);
this
.
off
(
"
mouseup
"
,
this
.
moveInteraction
.
endMove
,
this
.
moveInteraction
);
parent
.
interactive
=
false
;
parent
.
off
(
"
mousedown
"
,
this
.
moveInteraction
.
startMove
,
this
.
moveInteraction
);
parent
.
off
(
"
pointermove
"
,
this
.
moveInteraction
.
onMove
,
this
.
moveInteraction
);
parent
.
off
(
"
mouseup
"
,
this
.
moveInteraction
.
endMove
,
this
.
moveInteraction
);
// -- Debounce
this
.
off
(
"
debouncedUnselectLayerGroup
"
,
this
.
_debounceUndelectLayerGroupMethod
);
this
.
off
(
"
debouncedUnselectGrouping
"
,
this
.
_debounceUndelectGroupingMethod
);
...
...
@@ -905,6 +909,10 @@ export class Image extends BaseContainer<ImageModel> {
(
this
.
canvas
.
height
-
this
.
dimensions
.
height
*
this
.
_scaleY
)
/
2
);
// Emit
debounce
(
this
.
emit
.
bind
(
this
,
"
imageZoom
"
),
50
)();
// Promise
return
Promise
.
resolve
();
}
...
...
@@ -1015,11 +1023,6 @@ export class Image extends BaseContainer<ImageModel> {
// -- Context
this
.
on
(
"
rightup
"
,
this
.
contextInteraction
.
endRight
,
this
.
contextInteraction
);
//</editor-fold>
//<editor-fold desc="Interactions">
// -- Move interaction
this
.
moveInteraction
.
on
(
"
endMove
"
,
this
.
endMove
,
this
);
//</editor-fold>
}
/**
...
...
@@ -1034,11 +1037,6 @@ export class Image extends BaseContainer<ImageModel> {
// -- Context
this
.
off
(
"
rightup
"
,
this
.
contextInteraction
.
endRight
,
this
.
contextInteraction
);
//</editor-fold>
//<editor-fold desc="Interactions">
// -- Move interaction
this
.
moveInteraction
.
off
(
"
endMove
"
,
this
.
endMove
,
this
);
//</editor-fold>
}
/**
...
...
@@ -2230,11 +2228,21 @@ export class Image extends BaseContainer<ImageModel> {
debounce
(
this
.
emit
.
bind
(
this
,
"
onResize
"
),
50
)();
// TODO remove
// Promise
return
Promise
.
resolve
();
}
//</editor-fold>
//<editor-fold desc="Move">
public
startMove
(
event
:
PIXI
.
InteractionEvent
):
void
{
event
.
stopPropagation
();
// Cursor fix for stage
this
.
parent
.
cursor
=
"
move
"
;
this
.
renderer
.
plugins
.
interaction
.
cursorStyles
.
default
=
"
none
"
;
this
.
renderer
.
plugins
.
interaction
.
setCursorMode
(
"
move
"
);
}
/**
* On Move
* @param event
...
...
@@ -2300,6 +2308,17 @@ export class Image extends BaseContainer<ImageModel> {
*/
public
endMove
(
event
:
PIXI
.
InteractionEvent
):
void
{
event
.
stopPropagation
();
// Cursor fix for stage
this
.
parent
.
cursor
=
"
default
"
;
this
.
renderer
.
plugins
.
interaction
.
cursorStyles
.
default
=
(
mode
:
any
)
=>
{
const
cursor
=
this
.
parent
.
getChildByName
(
'
cursor
'
)
as
PIXI
.
Text
;
cursor
.
text
=
"
\
uf245
"
;
cursor
.
anchor
.
set
(
0
,
0
);
cursor
.
rotation
=
0
;
};
this
.
renderer
.
plugins
.
interaction
.
setCursorMode
(
"
default
"
);
if
(
!
this
.
_moveLock
)
{
// Reset selection
this
.
controlSetDefaultMode
(
event
);
...
...
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