DEV Community

Ramin
Ramin

Posted on

3 3

Pikaso v2.6 released

Pikaso v2.6 was released. The release contains a number of bug fixes and new features.

Introducing Background Size

From v2.6.0, both editor.loadFromUrl and editor.loadFromFile accept a second parameter with this interface

interface BackgroundOptions {
  size: 'auto' | 'resize' | 'cover' | 'contain' | 'stretch'
  x: number
  y: number
}
Enter fullscreen mode Exit fullscreen mode

The size field describes how a background image should be loaded in the canvas. The functionality is the same as the CSS feature background-size.

editor.loadFromUrl('<url>') // resizes canvas to to file's size by default

editor.loadFromUrl('<url>', {
  size: 'cover'
})

editor.loadFromFile('<File>', {
  size: 'stretch'
})
Enter fullscreen mode Exit fullscreen mode

Improve Label Shape

Labels can now be resized from different perspectives.
The following configuration should be followed to enable resizing from different aspects:
keepScale will be accessible as of v2.6.0 and by setting that to false, the default scaling behavior will be disabled.
Also, all options for Konva.Transformer are available through transformer

editor.shapes.label.insert({
    container: {/* config */},
    tag: {/* config */},
    text: {/* config */},
    config: {
      keepScale: false|true, // By setting keepScale to false, the default scaling behavior will be disabled
      transformer: {
        keepRatio: true, // keepRatio set to true to maintain scaling when scaling from corners
        enabledAnchors: ['middle-left', 'middle-right', 'bottom-right'] // Here are all the options available https://konvajs.org/api/Konva.Transformer.html#enabledAnchors__anchor
      }
    }
  })
Enter fullscreen mode Exit fullscreen mode

Improve Export/Import

zIndex export/import is now supported.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay