Skip to content

Commit

Permalink
resolution update
Browse files Browse the repository at this point in the history
  • Loading branch information
nczakaria committed Jul 28, 2015
1 parent 81aa1e3 commit 4ad39f0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 16 deletions.
1 change: 0 additions & 1 deletion KSKInterface/.flexLibProperties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<classEntry path="sg.edu.smu.ksketch2.canvas.controls.interactors.KMoveCenterInteractor"/>
<classEntry path="sg.edu.smu.ksketch2.KSketchWebLinks"/>
<classEntry path="sg.edu.smu.ksketch2.canvas.components.view.KSketch_HomeView_IconItemRenderer"/>
<classEntry path="sg.edu.smu.ksketch2.canvas.controls.KWebControl"/>
<classEntry path="sg.edu.smu.ksketch2.canvas.components.view.KSketch_HomeView"/>
<classEntry path="sg.edu.smu.ksketch2.canvas.controls.KSketch_CacheControl"/>
</includeClasses>
Expand Down
25 changes: 22 additions & 3 deletions KSKInterface/src/sg/edu/smu/ksketch2/KSketchStyles.as
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion KSKInterface/src/sg/edu/smu/ksketch2/KSketch_Config.as
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"
public static var isMobile:Boolean = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<fx:Declarations>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -483,6 +481,13 @@
_canvasNotice.open(this, true);
PopUpManager.centerPopUp(_canvasNotice);
}
protected function view_addedToStageHandler(event:Event):void
{
// TODO Auto-generated method stub
}
]]>
</fx:Script>
<s:Group width="100%" height="100%">
Expand Down Expand Up @@ -513,24 +518,24 @@

<s:Group width="100%">
<s:layout> <s:VerticalLayout paddingBottom="{KSketchStyles.NUMBER_10}"/> </s:layout>
<s:Button id="createButton" width="100%" click="createSketch()"/>
<s:Button id="createButton" width="100%" click="createSketch()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>

<!-- DESKTOP ENABLE -->
<s:Group width="100%">
<s:layout> <s:VerticalLayout paddingBottom="{KSketchStyles.NUMBER_10}"/> </s:layout>
<s:Button id="loadButton" width="100%" click="loadSketch()"/>
<s:Button id="loadButton" width="100%" click="loadSketch()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>
<!-- END OF DESKTOP ENABLE -->

<s:Group width="100%">
<s:layout> <s:VerticalLayout paddingBottom="{KSketchStyles.NUMBER_10}"/> </s:layout>
<s:Button id="loginButton" width="100%" click="navigateToScreen('Login')"/>
<s:Button id="loginButton" width="100%" click="navigateToScreen('Login')" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>

<s:Group width="100%">
<s:layout> <s:VerticalLayout paddingBottom="{KSketchStyles.NUMBER_10}"/> </s:layout>
<s:Button id="refreshButton" width="100%" click="refresh()"/>
<s:Button id="refreshButton" width="100%" click="refresh()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>

<!-- end alignment for buttons -->
Expand Down Expand Up @@ -559,7 +564,7 @@
</s:filters>
</s:Rect>

<s:Group top="15" left="15" right="15" bottom="15">
<s:Group top="{KSketchStyles.NUMBER_15}" left="{KSketchStyles.NUMBER_15}" right="{KSketchStyles.NUMBER_15}" bottom="{KSketchStyles.NUMBER_15}">
<s:Group width="100%" height="100%">
<s:layout>
<s:VerticalLayout></s:VerticalLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ad39f0

Please sign in to comment.