update the Hand's position on mouse-down - avoid triggering at the origin point

pull/95/head
jmoenig 2020-07-20 11:33:07 +02:00
rodzic 0644a74ab6
commit 6d7213588f
3 zmienionych plików z 12 dodań i 3 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
### 2020-07-20
* objects: fixed a list-watcher direct-editing offset bug
* morphic: update the Hand's position on mouse-down - avoid triggering at the origin point
### 2020-07-19
* blocks: blocks-fade-out support for label arrows (under construction)

Wyświetl plik

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Snap! Build Your Own Blocks 6.0.1 - dev -</title>
<link rel="shortcut icon" href="src/favicon.ico">
<script src="src/morphic.js?version=2020-07-16"></script>
<script src="src/morphic.js?version=2020-07-20"></script>
<script src="src/symbols.js?version=2020-07-01"></script>
<script src="src/widgets.js?version=2020-07-13"></script>
<script src="src/blocks.js?version=2020-07-20"></script>

Wyświetl plik

@ -1278,7 +1278,7 @@
/*global window, HTMLCanvasElement, FileReader, Audio, FileList, Map*/
var morphicVersion = '2020-July-17';
var morphicVersion = '2020-July-20';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = true;
@ -11279,8 +11279,16 @@ HandMorph.prototype.drop = function () {
*/
HandMorph.prototype.processMouseDown = function (event) {
var morph, actualClick;
var morph, actualClick,
posInDocument = getDocumentPositionOf(this.world.worldCanvas);
// update my position, in case I've just been initialized
this.setPosition(new Point(
event.pageX - posInDocument.x,
event.pageY - posInDocument.y
));
// process the actual event
this.destroyTemporaries();
this.contextMenuEnabled = true;
this.morphToGrab = null;