do not allow empty canvas rectangle and
restriction applied correctly when setting the visible rectangle
fixes #38