Skip to content

Morpho 0.8.1

Choose a tag to compare

@morpho-matters morpho-matters released this 30 Aug 19:47
· 384 commits to master since this release
2d421e9

Changes

  • The default stroke width used for the drawIn() Path action was changed from 3 to 2.
  • Frame tweening now checks for equal subfigure counts and throws an error if attempting to tween two Frames of unequal subfigure counts.

New Features

  • All figures now possess a modifier attribute which can be set to a function that will modify (a copy of) the figure at draw time, enabling an organic way for a figure's state to change dynamically based on another figure's state.
  • Added FigureArray which is like Frame but can be used to more easily create and manipulate figures laid out in a grid pattern.
  • Added new roundedRect() function to morpho.shapes that returns a Spline in the shape of an (approximate) rounded rectangle---that is, a rectangle with circular arc corners.
  • Added substagger option to the drawIn() MultiPath/MultiSpline action enabling more control over the time offset in animating adjacent glyphs being drawn in in (for example) a LaTeX figure.
  • Added popIn() and popOut() actions for Paths and Splines and their Multi variants.
  • New pulse() action for Point figures which causes a point to grow and then shrink again. Useful for drawing the viewer's eye to the point.
  • New waitUntilSec() Animation method acts like waitUntil() but the inputted target time is in units of seconds instead of frames.
  • New timelineCoord() Animation method which converts true playback times into local animation timeline coordinates, taking into account any animation delays. Kind of like an inverse seconds() method.
  • New listselect() function added to morpho.tools.basics which takes a list and a collection of indices or index slices and returns a dict mapping individual indices to list elements.

Improvements

  • Frame.merge() can now take an optional beforeFigure parameter that functions similar to how beforeActor and beforeLayer work for Layer.merge() and Animation.merge().
  • Frame.setName() now returns the Frame instance that calls it.
  • Frame figures (and their derivatives like MultiFigures) are now considered BoundingBoxFigures, and so support methods like box(), left(), right(), center(), etc.
    • Note that these methods will fail if the Frame contains any subfigures that are not BoundingBoxFigures.
  • Added optional select parameter to Frame and MultiFigure fade actions as well as MultiPath/MultiSpline drawIn() action.
  • Added optional straight keyword parameter to Spline's and SpaceSpline's close() method which if set to False closes the spline not with a straight line segment but according to the current state of its tangent handles.
  • Added dash and dashOffset attributes to Point figures.
  • Multiactions can now be run from unregistered actions.
    • Previously to apply an actor action across a list of actors, the action had to be named and registered so that it could be accessed via the command morpho.action.actionname(actorlist, ...). But now this functionality is available to unregistered (e.g. user-made) actions via the syntax morpho.action(mycustomaction, actorlist, ...)
  • Optimized subaction substaggering.
  • Implemented a collective subaction command morpho.subaction analogous to morpho.action.
  • Streamlined the interface for multiactions and multisubactions.
    • The collective action commands morpho.action.actionname and morpho.subaction.actionname should now work on any action that is "standard", meaning the action only affects an actor by possibly modifying its current final keyfigure and/or adding new keyfigures after it; i.e. they affect only the present and future of an actor, not its past. Essentially all built-in actions are "standard" and so will work with the collective action commands.
  • The highlight() and flourish() actions are now available for vanilla (i.e. non-Multi) Paths and Splines.
  • The highlight() and flourish() actions can now take an explicit None input for its fill parameter, which will prevent the actions from modifying the fill parameter.
  • Implemented toPolygon() and toPath() for the Ellipse class.
  • All BoundingBoxFigures now possess a boxDimensions() method that returns both box width and box height as a tuple.
  • finitizeDelays() can now accept a delay value of zero.
  • If waitUntil() and waitUntilSec() throw an error for trying to wait a negative amount of time, they now report the undershot time in seconds in addition to frames.
  • Optimized Actor now() method with caching so it's more efficient if called multiple times at the same point on the timeline.

Bug Fixes

  • Fixed a bug with setting subfigure names for MultiFigures.
  • Fixed a bug with Frame fadeOut() action in which the final keyfigure may not be set to be invisible if select is used to select a proper subset of the subfigures.
  • Fixed a bug with MultiFigure subactions where using it with no substaggering nor special selections resulted in transitions being ignored.