iliak's picture

Bad Window resize

Project:The Open Toolkit library
Version:0.9.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

When you set GameWindow.Height or GameWindow.Width, it resize the whole window, not the client part. Here's a piece of code to correct the problem for Windows :

/// <summary>
/// Gets/Sets the size of the window
/// </summary>
public Size Size
{
	get
	{
		if (Form != null)
			return Form.ClientSize;
		else
			return Size.Empty;
	}
	set
	{
		if (Form != null)
			Form.ClientSize = value;
	}
}

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» by design

This is by design. Windows.Forms also follow the same pattern.

Jonas B's picture

#2

I agree it should follow the same pattern, but it's important to have control over the client size - is there a reason for not including the ClientSize property?

the Fiddler's picture

#3

The only reason is that it is slightly more difficult to get the client size instead of the window size, so the latter was implemented first. The GameWindow redesign (WIP) contains both properties.