fix pencil breaking on top/left edges