I edited the following bits in your patch and merged your work.
1. screen and canvas size -> screen and canvas sizes
2. I converted spaces to tabular symbols for indentation
3. I appended my signed-off line to your patch
Your work is at
git://github.com/sebhtml/Ray-Cloud-Browser.git 4030605c42194accefdc2e3c6b8dbcb70ad46da0
or at
https://github.com/sebhtml/Ray-Cloud-Browser/commit/4030605c42194accefdc2e3c6b8dbcb70ad46da0
Thank you.
On 02/01/2013 06:21 PM, Pier-Luc Plante wrote:
> Fixed?
>
> commit: 36e44fc52d3b1013f6990e4d3b3dfb44e5f79160
> git://github.com/plpla/Ray-Cloud-Browser.git master
>
> PL
>
> Le 2013-02-01 16:43, Sébastien Boisvert a écrit :
>> This code should probably go in draw() in Screen because the iterate() method
>> runs the physics engine and has nothing to do with rendering,
>>
>> On 02/01/2013 04:24 PM, Pier-Luc Plante wrote:
>>> Signed-off-by: Pier-Luc Plante <pie...@ul...>
>>> ---
>>> client/Screen.js | 20 ++++++++++++++++++++
>>> 1 file changed, 20 insertions(+)
>>>
>>> diff --git a/client/Screen.js b/client/Screen.js
>>> index 97bd068..119cdf7 100644
>>> --- a/client/Screen.js
>>> +++ b/client/Screen.js
>>> @@ -583,6 +583,9 @@ Screen.prototype.iterate=function(){
>>> }
>>>
>>> this.performZoomOperations();
>>> + if(!this.checkScreenSize()){
>>> + this.performScreenSizeChange();
>>> + }
>>>
>>> var end=this.getMilliseconds();
>>> this.gameMilliseconds+=(end-start);
>>> @@ -591,6 +594,23 @@ Screen.prototype.iterate=function(){
>>> this.globalGameFrameNumber++;
>>> }
>>>
>>> +Screen.prototype.checkScreenSize=function(){
>>> + return(this.width==window.innerWidth && this.height==window.innerHeight &&
>>> + this.canvas.width==this.width && this.canvas.heidth==this.height &&
>>> + this.renderingCanvas.width==this.width && this.renderingCanvas.height==this.height);
>>> +}
>>> +
>>> +Screen.prototype.performScreenSizeChange=function(){
>>> + var availableWidth=window.innerWidth;
>>> + var availableHeight=window.innerHeight;
>>> + this.width=availableWidth;
>>> + this.height=availableHeight;
>>> + this.canvas.width=this.width;
>>> + this.canvas.height=this.height;
>> This resets the canvas. So this method should be called somewhere before the drawing.
>>
>>> + this.renderingCanvas.width=this.width;
>>> + this.renderingCanvas.height=this.height;
>> OK.
>>
>>> +}
>>> +
>>> Screen.prototype.getMilliseconds=function(){
>>> return new Date()*1;
>>> }
>>>
>>
>
|