The properties in the canvas as for the width and rect. etc., should not be used as a reference, its use is only valid when the canvas is in play and even then, it really shouldn't be used because it can stagnate in values that do not seem to follow the course of your code.
You may find at times the value there could be at some obscured value, like 2000x2000 or even more.
You may even find old left over values from where the client was larger and you just reduced the size of the form, it will report the largest ever value that it reached but not reduce when client shrinks.
use the client properties to obtain this needed info.