30daysJS-07 - HTML5 Canvas

路径生命周期必须和一次绘画行为对齐，而不是和mousemove对齐。 没学过canvas，所以这次跟着教程写代码。 问题 先写了这样的 < script > const canvas = document . querySelector ( "#draw" ); const ctx = canvas . getContext ( "2d" ); canvas . width = window . innerWidth ; canvas . height = window . innerHeight ; ctx . strokeStyle = "#aec600" ; ctx . lineJoin = "round" ; ctx . lineCap = 'round' ; let isDrawing = false ; let lastX = 0 ; let lastY = 0 ;…