Optimized StrokeUnstrokeX