From 04c6e76d8e9516953b831afd0185b22ce4d6b70e Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Sun, 10 Jan 2010 22:07:40 +0000 Subject: [PATCH] - the presentation window when resized disappears, something broke on the last checkin...this will at least fix the disappearing window git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3277 af16638f-c34d-0410-8cfa-b39d5352b314 --- .../present/events/WindowResizedEvent.as | 17 +++ .../present/views/PresentationWindow.mxml | 70 ++++++----- .../modules/present/views/SlideView.mxml | 118 ++++++++++++++---- 3 files changed, 151 insertions(+), 54 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/WindowResizedEvent.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/WindowResizedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/WindowResizedEvent.as new file mode 100644 index 0000000000..af9edf8c4e --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/WindowResizedEvent.as @@ -0,0 +1,17 @@ +package org.bigbluebutton.modules.present.events +{ + import flash.events.Event; + + public class WindowResizedEvent extends Event + { + public static const PRESENTATION_WINDOW_RESIZED_EVENT:String = "PRESENTATION_WINDOW_RESIZED_EVENT"; + public var width:int = 450; + public var height:int = 450; + + public function WindowResizedEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=true) + { + super(type, bubbles, cancelable); + } + + } +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/PresentationWindow.mxml index e88c8a21ff..22c3a7cde7 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/PresentationWindow.mxml @@ -46,6 +46,7 @@ @@ -396,7 +405,7 @@ verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalCenter="top"/> - + @@ -412,9 +421,6 @@ allowTrackClick="true" liveDragging="true" change="sliderZoom()" width="100" /> - diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/SlideView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/SlideView.mxml index da5e853607..8e02af9ddd 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/SlideView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/views/SlideView.mxml @@ -25,9 +25,9 @@ xmlns:panzoom="com.adobe.wheelerstreet.fig.panzoom.*" xmlns:local="*" width="100%" height="100%" - horizontalAlign="center" paddingBottom="5" + horizontalAlign="center" paddingBottom="5" resize="resizeSlideMaintainingAspectRatio()" creationComplete="init()" verticalScrollPolicy="off" horizontalScrollPolicy="off" - resize="fitSlideToWindow()" rollOut="hideCursor()"> + rollOut="hideCursor()"> @@ -37,7 +37,7 @@ - + = slideWidth()); + } + + private function isTopEdgeAligned():Boolean { + return slideY() == canvasY(); + } + + private function isBottomEdgeAligned():Boolean { + return ((Math.abs(slideY()) + canvasHeight()) >= slideHeight()); + } + + private function isLeftEdgeAligned():Boolean { + return slideX() == canvasX(); + } + + private function snapSlideToTopOfCanvas():void { + swfSlideLoader.y = swfSlideLoader.content.y = canvasY(); + } + + private function snapSlideToLeftSideOfCanvas():void { + swfSlideLoader.x = swfSlideLoader.content.x = canvasX(); + } + + /* + * Fire an event when a single slide has been loaded. + */ private function listenForSlideLoadedCompleteEvent():void { swfSlideLoader.addEventListener(Event.COMPLETE, handleSlideLoadedCompleteEvent); } @@ -249,8 +316,15 @@ slideRealWidth = slideWidth(); slideRealHeight = slideHeight(); LogUtil.debug("handleSlideLoadCompleteEvent[" + slideRealWidth + "," + slideRealHeight + "]"); - + makeSlideFitToWindow = true; fitSlideToWindow(); + +// var dispatcher:Dispatcher = new Dispatcher(); +// var dispEvent:DisplaySlideEvent = new DisplaySlideEvent(DisplaySlideEvent.DISPLAY_SLIDE_EVENT); +// dispEvent.slideWidth = slideRealWidth; +// dispEvent.slideHeight = slideRealHeight; +// dispatcher.dispatchEvent(dispEvent); + } /***************************************** @@ -281,11 +355,11 @@ return swfSlideLoader.y; } - private function slideCanvasWidth():int { + private function canvasWidth():int { return slideCanvas.width; } - private function slideCanvasHeight():int { + private function canvasHeight():int { return slideCanvas.height; } @@ -379,7 +453,7 @@ -