Skip to content

v0.2.0

Latest

Choose a tag to compare

@lee2sman lee2sman released this 18 Aug 17:38

add annotations for all public functions API; fix several bugs found along the way
Annotations:

  • full param/return/overload documentation for all public functions, for autocomplete and Lua language server
  • Added L5-specific aliases for Image, Video, Font

Bug Fixes:

  • ellipse() - fixed incorrect y-coordinate calculation in CORNERS mode
  • circle() - removed broken CORNERS mode (undefined if no _d defined), throws error if in CORNERS mode
  • square() - errors if used in CORNERS mode (same problem as circle, unsupported)
  • fixed asin()/acos()/atan() to convert output to degrees in DEGREES mode, not input
  • round(): rounds half up rather than just away from zero (matches Processing/p5)
  • int()/fract() truncate toward zero
  • char() - fixed input check (should only be 0 - 127, won't crash now)
  • textWidth() / textHeight() - fixed to return correct value if default font set
  • textSize() - added back returning font size if no argument passed
  • fixed table handling for color in stroke() and background()
  • filter(): removed ERODE/DILATE parameter override, which was undefined, now approaches parity with p5/Processing
  • get(): 2 argument form returns {R, G, B, A} table instead of 4 separate vars (breaks r,g,b,a = get(x,y)
  • exit() now uses love.event.quit() for cleaner Love2d cleanup handling
  • added input validation to functions including sqrt(), log(), hex() and strokeJoin()
  • textDescent(): normalized to return a positive value to match p5.js output

Internal:

  • moved non-public functions to table methods of L5_internal to hide them from global namespace
  • removed unused getPixelIndex() / setPixel() since redundant with set() and p5 doesn't have this separated either