- figure out why we dispatch a text created event when mouse moves out of canvas
This commit is contained in:
parent
9b4a1b4815
commit
e95e4c72f0
@ -158,7 +158,7 @@ package org.bigbluebutton.modules.whiteboard
|
||||
var tobj:TextObject = calibrateNewTextWith(o);
|
||||
tobj.multiline = true;
|
||||
tobj.wordWrap = true;
|
||||
tobj.autoSize = TextFieldAutoSize.LEFT;
|
||||
// tobj.autoSize = TextFieldAutoSize.LEFT;
|
||||
tobj.makeEditable(true);
|
||||
tobj.border = true;
|
||||
// LogUtil.debug("Putting text object [" + tobj.getGraphicID() + "] in [" + tobj.x + "," + tobj.y + "]");
|
||||
@ -178,7 +178,7 @@ package org.bigbluebutton.modules.whiteboard
|
||||
//LogUtil.debug("TEXT ADDED: " + tobj.getGraphicID());
|
||||
tobj.multiline = true;
|
||||
tobj.wordWrap = true;
|
||||
tobj.autoSize = TextFieldAutoSize.LEFT;
|
||||
// tobj.autoSize = TextFieldAutoSize.LEFT;
|
||||
tobj.makeEditable(false);
|
||||
tobj.border = true;
|
||||
wbCanvas.addGraphic(tobj);
|
||||
|
@ -17,6 +17,8 @@ package org.bigbluebutton.modules.whiteboard.views
|
||||
private var _mouseXDown:Number = 0;
|
||||
private var _mouseYDown:Number = 0;
|
||||
|
||||
private var _mousedDown:Boolean = false;
|
||||
|
||||
public function TextDrawListener(wbCanvas:WhiteboardCanvas, sendShapeFrequency:int, shapeFactory:ShapeFactory)
|
||||
{
|
||||
_wbCanvas = wbCanvas;
|
||||
@ -29,6 +31,11 @@ package org.bigbluebutton.modules.whiteboard.views
|
||||
if(tool.graphicType == WhiteboardConstants.TYPE_TEXT) {
|
||||
_mouseXDown = mouseX;
|
||||
_mouseYDown = mouseY;
|
||||
|
||||
// We have to keep track if the user has pressed the mouse. A mouseup event is
|
||||
// dispatched when the mouse goes out of the canvas, theu we end up sending a new text
|
||||
// even if the user has mousedDown yet.
|
||||
_mousedDown = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +46,10 @@ package org.bigbluebutton.modules.whiteboard.views
|
||||
|
||||
public function onMouseUp(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
||||
{
|
||||
if(tool.graphicType == WhiteboardConstants.TYPE_TEXT) {
|
||||
if(tool.graphicType == WhiteboardConstants.TYPE_TEXT && _mousedDown) {
|
||||
|
||||
_mousedDown = false;
|
||||
|
||||
var tbWidth:Number = mouseX - _mouseXDown;
|
||||
var tbHeight:Number = mouseY - _mouseYDown;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user