Revision: 3816
Author: seba.wagner
Date: Mon Jun 13 07:52:13 2011
Log: distinguish between snaptogrid and showGrid
http://code.google.com/p/openmeetings/source/detail?r=3816
Modified:
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/base/baseDraw.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/base/baseDrawWords.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/helper/boundingBoxAll.lzx
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/base/baseDraw.lzx
Wed Jun 8 06:05:06 2011
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/base/baseDraw.lzx
Mon Jun 13 07:52:13 2011
@@ -29,6 +29,7 @@
<event name="onupdateScale" />
+ <attribute name="showGrid" type="boolean" value="false"/>
<attribute name="isSnapToGrid" type="boolean" value="false"/>
<attribute name="gridWidth" value="24" type="number" />
@@ -236,8 +237,8 @@
<![CDATA[
if (this.boundingref!=null) this.boundingref.removeIt();
- while (this.subviews.length > 0) {
- this.subviews[0].destroy();
+ while (this.subviews.length > 1) {
+ this.subviews[1].destroy();
}
while (this.basdrawredoView.subviews.length > 0) {
this.basdrawredoView.subviews[0].destroy();
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/base/baseDrawWords.lzx
Sun Feb 14 03:47:30 2010
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/base/baseDrawWords.lzx
Mon Jun 13 07:52:13 2011
@@ -54,6 +54,14 @@
if ($debug) Debug.write("this.refObj.y ",this.refObj.y);
if ($debug)
Debug.write("this.x-this.refObj.x-this.refObj.parent.x ",y);
var x = (
this.getAttributeRelative('x',this.refObj)-this.refObj.x+1 );
+
+ if(canvas._drawarea.isSnapToGrid){
+
+ x =
Math.round(x/canvas._drawarea.gridWidth)*canvas._drawarea.gridWidth;
+ y =
Math.round(y/canvas._drawarea.gridWidth)*canvas._drawarea.gridWidth;
+
+ }
+
this.refObj.drawTextField(this._textview._textview.getText(),
this._textview._textview.width,
this._textview._textview.height,x,y);
@@ -65,6 +73,13 @@
if ($debug)
Debug.write("this.x-this.refObj.x-this.refObj.parent.x ",y);
var x =
(this.getAttributeRelative('x',this.refObj)-this.refObj.x+1);
+ if(canvas._drawarea.isSnapToGrid){
+
+ x =
Math.round(x/canvas._drawarea.gridWidth)*canvas._drawarea.gridWidth;
+ y =
Math.round(y/canvas._drawarea.gridWidth)*canvas._drawarea.gridWidth;
+
+ }
+
this.refObj.setTextFieldByName(this.initTextName,
this._textview._textview.getText(),
this._textview._textview.width,
@@ -72,6 +87,9 @@
} else {
if ($debug) Debug.write("text smaller then
0",this._textview._textview.getText());
+
+ if ($debug)
Debug.write("this.gridWidth",canvas._drawarea.gridWidth);
+ if ($debug)
Debug.write("this.isSnapToGrid",canvas._drawarea.isSnapToGrid);
}
this.giveup();
]]>
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/helper/boundingBoxAll.lzx
Sun Apr 3 07:09:17 2011
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/whiteboard/helper/boundingBoxAll.lzx
Mon Jun 13 07:52:13 2011
@@ -20,7 +20,7 @@
</method>
-->
<method name="removeIt">
- //Debug.write("removeIt +**********",this.isinited);
+ if ($debug) Debug.write("removeIt +**********",this.isinited);
this.whiteboardRef.setAttribute('boundingIsActive',false);
if (this.rs) this.rs.remove();
if (this.dragger) this.dragger.remove();
@@ -172,13 +172,29 @@
<handler name="onx">
if(this.doHandlerUpdates){
-
this.objRef.setAttribute('x',this.getAttributeRelative('x',objRef));
+
+ var tx = this.getAttributeRelative('x',objRef);
+
+ if(this.objRef.parent.isSnapToGrid){
+ tx =
Math.round(tx/this.objRef.parent.gridWidth)*this.objRef.parent.gridWidth;
+
this.setAttribute("x",Math.round(this.x/this.objRef.parent.gridWidth)*this.objRef.parent.gridWidth)
+ }
+
+ this.objRef.setAttribute('x',tx);
}
</handler>
<handler name="ony">
if(this.doHandlerUpdates){
-
this.objRef.setAttribute('y',this.getAttributeRelative('y',objRef));
+
+ var ty = this.getAttributeRelative('y',objRef);
+
+ if(this.objRef.parent.isSnapToGrid){
+ ty =
Math.round(ty/this.objRef.parent.gridWidth)*this.objRef.parent.gridWidth;
+
this.setAttribute("y",Math.round(this.y/this.objRef.parent.gridWidth)*this.objRef.parent.gridWidth)
+ }
+
+ this.objRef.setAttribute('y',ty);
}
</handler>
--
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en.