Giter Site home page Giter Site logo

Comments (3)

bensladden avatar bensladden commented on June 7, 2024

Ive added the event @image-loaded to the most recent release for each type of image from url component.
From this you can now access the img width etc.
v0.3.70

`
<fabric-background-image
:id="345667"
:scaleX="400 / imgWidth"
:scaleY="400 / imgHeight"
@image-loaded="imageLoaded"
>

...

imageLoaded(img) {
  this.imgHeight = img.height;
  this.imgWidth = img.width;
},`

assuming 400 is the width and height etc

from vue-fabric-wrapper.

johnny-longneck avatar johnny-longneck commented on June 7, 2024

Hello, thanks for your quick answer.

It is getting close. The only problem left now, is that the background of the canvas is only updating its scaling, when I touch an element in the canvas, and force a rerender.
I tried it in the imageLoaded function with

this.$refs.canvas0[0].requestRenderAll()

But it is not working here. It is working on other parts of the code, tough

from vue-fabric-wrapper.

johnny-longneck avatar johnny-longneck commented on June 7, 2024

Okay I got it working, I first had a mindfuck but doint it exactly as you wrote worked.
Thanks a lot!

from vue-fabric-wrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.