ID:1985736
 
BYOND Version:508
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 42.0
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
The resize command in the Interface file is not being called when the client window maximizes.

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:


Expected Results:
The resize command is called upon window maximize.

Actual Results:
It does not call the command.

Does the problem occur:
Every time? Or how often?
Every time
In other games?
Yes
In other user accounts?
Yes
On other computers?
Yes
You should remove the elements you aren't using to make the report cleaner.

Anyway, it does call it, just not when the window is dragged to the top.

This stack overflow answer is likely relevant: http://stackoverflow.com/a/25983187/583841
In response to Somepotato
Nah, I'm using the maximize button.
I can't reproduce this issue and I'm using windows 10 (in your case anyway). Can you give us the code you were using?
mob/verb/resize()
var/size = winget(src,"default","size")
var/x = findtext(size,"x") //Returns a numeric value, where 'x' is located in the string
var/WIDTH = text2num(copytext(size,1,x)) //Copy the text from the first placement to before the 'x'
var/HEIGHT = text2num(copytext(size,x+1)) //Copy the text after the 'x'
WIDTH = round(WIDTH/32) //Receive a whole number. This ratio works 1:1, 1 pixel for each pixel on screen. Modify that by changing '32'
HEIGHT = round(HEIGHT/32) //Same as above
client.view = "[WIDTH]x[HEIGHT]"
It is being called, it is just that winget isn't getting the size correctly.

Of an unrelated note, try to remember about the increased network and CPU usage that comes with using a massive viewport.
In response to Somepotato
Yeah, I think the "size" of a window refers to the un-maximized size.

Konlet, in this case, you should definitely use the size of the map element instead. Also, round up to an odd number of tiles if you want to make sure the view fills the screen and keeps the player centered.
In response to Kaiochao
client.pixel_x/y might be able to be used here for more precision, but would also require more math.
In response to Kaiochao
Thanks, Kaio. TBH though, I already was reading the map element, just didn't reference it in the snippet.
I'd still consider this a bug that needs resolving though; because the resize also doesn't get called when the window is dragged to the top and this should report the maximized size.