canvas.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @description Draw a polyline path
  3. * @param {Object} ctx Canvas 2d context
  4. * @param {Array} points The points that makes up a polyline
  5. * @param {Boolean} beginPath Whether to execute beginPath
  6. * @param {Boolean} closePath Whether to execute closePath
  7. * @return {Undefined} Void
  8. */
  9. export function drawPolylinePath (ctx, points, beginPath = false, closePath = false) {
  10. if (!ctx || points.length < 2) return false
  11. if (beginPath) ctx.beginPath()
  12. points.forEach((point, i) =>
  13. point && (i === 0 ? ctx.moveTo(...point) : ctx.lineTo(...point)))
  14. if (closePath) {
  15. ctx.closePath()
  16. ctx.draw()
  17. }
  18. }
  19. /**
  20. * @description Draw a bezier curve path
  21. * @param {Object} ctx Canvas 2d context
  22. * @param {Array} points The points that makes up a bezier curve
  23. * @param {Array} moveTo The point need to excute moveTo
  24. * @param {Boolean} beginPath Whether to execute beginPath
  25. * @param {Boolean} closePath Whether to execute closePath
  26. * @return {Undefined} Void
  27. */
  28. export function drawBezierCurvePath (ctx, points, moveTo = false, beginPath = false, closePath = false) {
  29. if (!ctx || !points) return false
  30. if (beginPath) ctx.beginPath()
  31. if (moveTo) ctx.moveTo(...moveTo)
  32. points.forEach(item => (item && ctx.bezierCurveTo(...item[0], ...item[1], ...item[2])))
  33. if (closePath) {
  34. ctx.closePath()
  35. ctx.draw()
  36. }
  37. }
  38. export default {
  39. drawPolylinePath,
  40. drawBezierCurvePath
  41. }
PANIC: session(release): write data/sessions/6/c/6c939eb5f30ed383: no space left on device

PANIC

session(release): write data/sessions/6/c/6c939eb5f30ed383: no space left on device
/root/go/pkg/mod/github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8bc0f8)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:81 (0x83623b)
/root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80b5f4)
/root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80b51c)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:125 (0x8363b2)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:115 (0x8473a6)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/recovery.go:161 (0x84739d)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/logger.go:40 (0x839a24)
/root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80b5f4)
/root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80b51c)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:125 (0x8363b2)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/router.go:187 (0x8412dd)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/router.go:304 (0x8423ec)
/root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/macaron.go:218 (0x83adde)
/usr/local/btgo/src/net/http/server.go:2936 (0x7b23b5)
	serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/local/btgo/src/net/http/server.go:1995 (0x7add91)
	(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/local/btgo/src/runtime/asm_amd64.s:1598 (0x47e160)
	goexit: BYTE	$0x90	// NOP