check canvas before doing transformation