fix for small canvas resize bug