diff --git a/KSKInterface/.flexLibProperties b/KSKInterface/.flexLibProperties index 11008d41..ffbe90e6 100755 --- a/KSKInterface/.flexLibProperties +++ b/KSKInterface/.flexLibProperties @@ -19,7 +19,6 @@ - diff --git a/KSKInterface/src/sg/edu/smu/ksketch2/KSketchStyles.as b/KSKInterface/src/sg/edu/smu/ksketch2/KSketchStyles.as index 76f52a94..cba4403c 100755 --- a/KSKInterface/src/sg/edu/smu/ksketch2/KSketchStyles.as +++ b/KSKInterface/src/sg/edu/smu/ksketch2/KSketchStyles.as @@ -85,12 +85,31 @@ package sg.edu.smu.ksketch2 public static var NUMBER_1100:Number = 1100; public static var NUMBER_1200:Number = 1200; + public static var width:int = 0; + public static var height:int = 0; + public static var aspectRatio:Number = 0; + + public static function setResolution():void + { + if(Capabilities.screenResolutionX > Capabilities.screenResolutionY) + { + width = Capabilities.screenResolutionX; + height = Capabilities.screenResolutionY; + } + else + { + width = Capabilities.screenResolutionY; + height = Capabilities.screenResolutionX; + } + + aspectRatio = int((width/height)*100)/100; + } + public static function setView():void { - //trace("Screen X: " + Capabilities.screenResolutionX); - //trace("Screen Y: " + Capabilities.screenResolutionY); + setResolution(); - if(Capabilities.screenResolutionX > 1024 && Capabilities.screenResolutionY > 768) + if(width > 1280 && height > 960) { KSketchStyles.scale(2); } diff --git a/KSKInterface/src/sg/edu/smu/ksketch2/KSketch_Config.as b/KSKInterface/src/sg/edu/smu/ksketch2/KSketch_Config.as index 7d36d105..0a6b2c3e 100644 --- a/KSKInterface/src/sg/edu/smu/ksketch2/KSketch_Config.as +++ b/KSKInterface/src/sg/edu/smu/ksketch2/KSketch_Config.as @@ -3,7 +3,7 @@ */ package sg.edu.smu.ksketch2 { public class KSketch_Config { - public static const host_name = "http://ksketch.smu.edu.sg" + public static const host_name = "http://ed92f17c.ngrok.io" public static const email = "ksketch@smu.edu.sg" public static var isMobile:Boolean = false; } diff --git a/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_CanvasView.mxml b/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_CanvasView.mxml index e633e33f..429e4c93 100755 --- a/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_CanvasView.mxml +++ b/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_CanvasView.mxml @@ -528,9 +528,13 @@ { KSketchStyles.setView(); - if(Capabilities.screenResolutionX > 1024) + if(KSketchStyles.aspectRatio != 1.33) + { + drawing_stage.percentHeight = 82; + drawing_stage.width = drawing_stage.height/9*16; + } + else if(KSketchStyles.width > 1280 && KSketchStyles.aspectRatio == 1.33) { - trace("init drawing stage"); drawing_stage.percentHeight = 80; drawing_stage.width = drawing_stage.height/9*16; } diff --git a/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView.mxml b/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView.mxml index 7f30ca30..f63faa6d 100644 --- a/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView.mxml +++ b/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView.mxml @@ -16,6 +16,7 @@ xmlns:buttons="sg.edu.smu.ksketch2.canvas.components.buttons.*" xmlns:popup="sg.edu.smu.ksketch2.canvas.components.popup.*" initialize="init(true)" + addedToStage="KSketchStyles.setView();" destructionPolicy="auto" > @@ -83,9 +84,6 @@ private var itemRender:IFactory = new ClassFactory(KSketch_HomeView_IconItemRenderer); private function init(isMobile:Boolean):void { - - KSketchStyles.setView(); - //Check for mobile version. Set false to export for Desktop version if (isMobile) { mainButtons.removeElementAt(2); @@ -483,6 +481,13 @@ _canvasNotice.open(this, true); PopUpManager.centerPopUp(_canvasNotice); } + + protected function view_addedToStageHandler(event:Event):void + { + // TODO Auto-generated method stub + + } + ]]> @@ -513,24 +518,24 @@ - + - + - + - + @@ -559,7 +564,7 @@ - + diff --git a/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView_IconItemRenderer.mxml b/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView_IconItemRenderer.mxml index 3340b77f..4d0684b3 100644 --- a/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView_IconItemRenderer.mxml +++ b/KSKInterface/src/sg/edu/smu/ksketch2/canvas/components/view/KSketch_HomeView_IconItemRenderer.mxml @@ -47,7 +47,7 @@ } override public function set data(value:Object):void { - if (value.thumbnailData) { + if (value != null && value.thumbnailData) { super.data = value; //set name and date properties