Get canvas viewport translate when zoomingHow do you get a timestamp in JavaScript?How to get the children of the $(this) selector?How can I get query string values in JavaScript?Get the current URL with JavaScript?Get the browser viewport dimensions with JavaScriptHow do I get the current date in JavaScript?How to clear the canvas for redrawingResizing an image in an HTML5 canvasUsing HTML5/Canvas/JavaScript to take in-browser screenshotsHow to decide when to use Node.js?

Would it be possible to have a GMO that produces chocolate?

Why is 日本 read as "nihon" but not "nitsuhon"?

Is there a known non-euclidean geometry where two concentric circles of different radii can intersect? (as in the novel "The Universe Between")

Which household object drew this pattern?

Why doesn't the Falcon-9 first stage use three legs to land?

Is there a limit on how long the casting (speaking aloud part of the spell) of Wish can be?

How should I face my manager if I make a mistake because a senior coworker explained something incorrectly to me?

What is the appropriate benchmark for a Long/Short VIX futures strategy?

Is a butterfly one or two animals?

How to compare two different formulations of a problem?

How would one country purchase another?

Is it appropriate for a prospective landlord to ask me for my credit report?

In what ways can a Non-paladin access Paladin spells?

Justifying the use of directed energy weapons

What is wrong about this application of Kirchhoffs Current Law?

Gamma GLM - Derive prediction intervals for new x_i

How do I find the fastest route from Heathrow to an address in London using all forms of transport?

Concatenation of the result of a function with a mutable default argument in python

Potential new partner angry about first collaboration - how to answer email to close up this encounter in a graceful manner

Is it possible to create a golf ball sized star?

Defense against attacks using dictionaries

In the MCU, why does Mjölnir retain its enchantments after Ragnarok?

Why we don't have vaccination against all diseases which are caused by microbes?

Avoiding racist tropes in fantasy



Get canvas viewport translate when zooming


How do you get a timestamp in JavaScript?How to get the children of the $(this) selector?How can I get query string values in JavaScript?Get the current URL with JavaScript?Get the browser viewport dimensions with JavaScriptHow do I get the current date in JavaScript?How to clear the canvas for redrawingResizing an image in an HTML5 canvasUsing HTML5/Canvas/JavaScript to take in-browser screenshotsHow to decide when to use Node.js?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















How i can get translate canvas viewport when zooming?



My zooming method:



 mouseZoom(opt) 









share|improve this question
























  • What are you want to achieve?

    – Daniel
    Mar 27 at 14:35











  • I have a popup whose coordinates depend on the coordinates of the object on the canvas, and when I zoom need to recalculate the coordinates for the popup, depending on the zoom factor.

    – Dmitriy
    Mar 27 at 15:59

















0















How i can get translate canvas viewport when zooming?



My zooming method:



 mouseZoom(opt) 









share|improve this question
























  • What are you want to achieve?

    – Daniel
    Mar 27 at 14:35











  • I have a popup whose coordinates depend on the coordinates of the object on the canvas, and when I zoom need to recalculate the coordinates for the popup, depending on the zoom factor.

    – Dmitriy
    Mar 27 at 15:59













0












0








0








How i can get translate canvas viewport when zooming?



My zooming method:



 mouseZoom(opt) 









share|improve this question














How i can get translate canvas viewport when zooming?



My zooming method:



 mouseZoom(opt) 






javascript canvas fabricjs zooming






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 12:56









DmitriyDmitriy

204 bronze badges




204 bronze badges















  • What are you want to achieve?

    – Daniel
    Mar 27 at 14:35











  • I have a popup whose coordinates depend on the coordinates of the object on the canvas, and when I zoom need to recalculate the coordinates for the popup, depending on the zoom factor.

    – Dmitriy
    Mar 27 at 15:59

















  • What are you want to achieve?

    – Daniel
    Mar 27 at 14:35











  • I have a popup whose coordinates depend on the coordinates of the object on the canvas, and when I zoom need to recalculate the coordinates for the popup, depending on the zoom factor.

    – Dmitriy
    Mar 27 at 15:59
















What are you want to achieve?

– Daniel
Mar 27 at 14:35





What are you want to achieve?

– Daniel
Mar 27 at 14:35













I have a popup whose coordinates depend on the coordinates of the object on the canvas, and when I zoom need to recalculate the coordinates for the popup, depending on the zoom factor.

– Dmitriy
Mar 27 at 15:59





I have a popup whose coordinates depend on the coordinates of the object on the canvas, and when I zoom need to recalculate the coordinates for the popup, depending on the zoom factor.

– Dmitriy
Mar 27 at 15:59












1 Answer
1






active

oldest

votes


















0













Take a look at canvas.viewportTransform property.



It contains all viewport transformation stored as array [a, b, c, d, tx, ty], where:



a -– x scale



b – y skew



c – x scew



d – y scale



tx – x translation



ty – y translation






share|improve this answer

























  • I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

    – Dmitriy
    Mar 27 at 18:07










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377760%2fget-canvas-viewport-translate-when-zooming%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0













Take a look at canvas.viewportTransform property.



It contains all viewport transformation stored as array [a, b, c, d, tx, ty], where:



a -– x scale



b – y skew



c – x scew



d – y scale



tx – x translation



ty – y translation






share|improve this answer

























  • I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

    – Dmitriy
    Mar 27 at 18:07















0













Take a look at canvas.viewportTransform property.



It contains all viewport transformation stored as array [a, b, c, d, tx, ty], where:



a -– x scale



b – y skew



c – x scew



d – y scale



tx – x translation



ty – y translation






share|improve this answer

























  • I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

    – Dmitriy
    Mar 27 at 18:07













0












0








0







Take a look at canvas.viewportTransform property.



It contains all viewport transformation stored as array [a, b, c, d, tx, ty], where:



a -– x scale



b – y skew



c – x scew



d – y scale



tx – x translation



ty – y translation






share|improve this answer













Take a look at canvas.viewportTransform property.



It contains all viewport transformation stored as array [a, b, c, d, tx, ty], where:



a -– x scale



b – y skew



c – x scew



d – y scale



tx – x translation



ty – y translation







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 27 at 16:26









DanielDaniel

1,0516 silver badges17 bronze badges




1,0516 silver badges17 bronze badges















  • I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

    – Dmitriy
    Mar 27 at 18:07

















  • I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

    – Dmitriy
    Mar 27 at 18:07
















I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

– Dmitriy
Mar 27 at 18:07





I tried this, but tx and ty more than the actual offset. Need some kind of coefficient for them

– Dmitriy
Mar 27 at 18:07








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377760%2fget-canvas-viewport-translate-when-zooming%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript