Added top and left margin modifications on canvas resizing to improve the resizing effect.