From 429d1e9a31d7ff2fc90482cb5402e2de27f7788f Mon Sep 17 00:00:00 2001 From: Markos Calderon Date: Tue, 26 Feb 2013 19:10:05 -0500 Subject: [PATCH] presenters preview desktopsharing centered --- .../view/components/DesktopPublishWindow.mxml | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml index 411a932a7a..0020905214 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml @@ -24,11 +24,11 @@ with BigBlueButton; if not, see . xmlns:mx="http://www.adobe.com/2006/mxml" implements="org.bigbluebutton.common.IBbbModuleWindow" xmlns:mate="http://mate.asfusion.com/" - xmlns:dspub="flexlib.mdi.containers.*" + xmlns:dspub="flexlib.mdi.containers.*" backgroundColor="#C0C0C0" creationComplete="onCreationComplete()" verticalScrollPolicy="off" horizontalScrollPolicy="off" - width="320" height="240" + width="320" height="240" title="{ResourceUtil.getInstance().getString('bbb.desktopPublish.title')}" resizable="false"> @@ -80,7 +80,7 @@ with BigBlueButton; if not, see . private var video:Video; private var ns:NetStream; - private var videoHolder:UIComponent; + [Bindable] private var videoHolder:UIComponent; private var stream:String; private var videoHeight:Number; private var videoWidth:Number; @@ -179,16 +179,16 @@ with BigBlueButton; if not, see . private function onUpdateCursorEvent(event:CursorEvent):void { // DO NOT compute the x and y coordinate and assign directly to the cursorImg // as it results in a flickering and jerky mouse pointer (ralam jun 10, 2010). - cursor.x = ((event.x/captureWidth)) * videoHolder.width; - cursor.y = ((event.y/captureHeight)) * videoHolder.height; + cursor.x = video.x + ((event.x/captureWidth)) * video.width; + cursor.y = video.y + ((event.y/captureHeight)) * video.height; cursorImg.visible = true; // Do not display cursor if they are outside the capture area. - if (cursor.x < videoHolder.x) cursor.x = videoHolder.x; - if (cursor.y < videoHolder.y) cursor.y = videoHolder.y; - if (cursor.x > videoHolder.x + videoHolder.width) cursor.x = videoHolder.x + videoHolder.width; - if (cursor.y > videoHolder.y + videoHolder.height) cursor.y = videoHolder.y + videoHolder.height; - cursorImg.x = cursor.x; + if (cursor.x < video.x) cursor.x = video.x; + if (cursor.y < video.y) cursor.y = video.y; + if (cursor.x > video.x + video.width) cursor.x = video.x + video.width; + if (cursor.y > video.y + video.height) cursor.y = video.y + video.height; + cursorImg.x = cursor.x; cursorImg.y = cursor.y; } @@ -209,14 +209,17 @@ with BigBlueButton; if not, see . captureHeight = capHeight; videoHolder = new UIComponent(); + var vidW:Number = captureWidth; var vidH:Number = captureHeight; // Don't scale if capture dimension is smaller than window. if ((captureWidth > this.width - VID_WIDTH_PAD) && (captureHeight > this.height - VID_HEIGHT_PAD)) { - vidW = this.width - VID_WIDTH_PAD; - vidH = this.height - VID_HEIGHT_PAD; + vidH = this.height - VID_HEIGHT_PAD; + vidW = (captureWidth / captureHeight) * vidH; + vidW = vidW + VID_WIDTH_PAD; } + LogUtil.debug("deskshare preview[" + captureWidth + "," + captureHeight + "][" + vidW + "," + vidH + "]"); video = new Video(vidW, vidH); @@ -224,6 +227,10 @@ with BigBlueButton; if not, see . video.height = vidH; videoHolder.width = vidW; videoHolder.height = vidH; + video.x = videoHolder.x = (this.width - VID_WIDTH_PAD - vidW) / 2; + video.y = videoHolder.y = (this.height - VID_HEIGHT_PAD - vidH) / 2; + + videoHolder.addChild(video); videoHolder.addChild(cursor); videoHolder.addChild(cursorImg);