fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d219970
)
scale initial mark with the image
author
Marcin Koziej
<marcin@lolownia.org>
Mon, 16 Dec 2013 11:06:57 +0000
(12:06 +0100)
committer
Marcin Koziej
<marcin@lolownia.org>
Mon, 16 Dec 2013 11:06:57 +0000
(12:06 +0100)
apps/wolnelektury_core/static/js/picture.js
patch
|
blob
|
history
diff --git
a/apps/wolnelektury_core/static/js/picture.js
b/apps/wolnelektury_core/static/js/picture.js
index
0d6d0cb
..
174a9ff
100644
(file)
--- a/
apps/wolnelektury_core/static/js/picture.js
+++ b/
apps/wolnelektury_core/static/js/picture.js
@@
-147,6
+147,10
@@
this._ratio = ratio;
this.element.css(target);
this._ratio = ratio;
this.element.css(target);
+ if (this._initial_mark) {
+ this._initial_mark = this.redrawMark(this._initial_mark);
+ }
+
},
allowedPosition: function(off) {
},
allowedPosition: function(off) {
@@
-188,7
+192,12
@@
return undefined;
},
return undefined;
},
-
+ redrawMark: function(mark) {
+ var $mark = $(mark);
+ var $newmark = this.createMark($mark.data('mark'));
+ $mark.remove();
+ return $newmark;
+ },
// mark
// {
// label: "...",
// mark
// {
// label: "...",
@@
-216,6
+225,8
@@
$mark.width(coords[1][0] - coords[0][0]);
$mark.height(coords[1][1] - coords[0][1]);
$mark.css({left: coords[0][0], top: coords[0][1]});
$mark.width(coords[1][0] - coords[0][0]);
$mark.height(coords[1][1] - coords[0][1]);
$mark.css({left: coords[0][0], top: coords[0][1]});
+
+ $mark.data('mark', mark);
return $mark.get(0);
},
});
return $mark.get(0);
},
});