Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:19:14+00:00 2026-06-12T06:19:14+00:00

How to rotate a dojox gfx at a new position? The shape is moveable

  • 0

How to rotate a dojox gfx at a new position?

The shape is moveable and has to be rotated and scaled at the new position. For demonstration i have used the Butterly Demo from dojox gfx. See this example at jsfiddle for the moveable butterfly.

How is it possible to rotate and scale the shape at the new position and the new center?

Thanks in advance,

mbecker

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:19:15+00:00Added an answer on June 12, 2026 at 6:19 am

    I forked your jsFiddle (http://jsfiddle.net/phusick/ta65D/) and added two instances of dijit/form/NumberSpinner (translateX & translateY) to move the butterfly thanks to modified updateMatrix function:

    var updateMatrix = function() {
        var translateX = xSpinner.get("value");
        var translateY = ySpinner.get("value");
    
        var centerX = 210 + translateX;
        var centerY = 170 + translateY;
    
        if(g) {
            g.setTransform([
                m.rotategAt(rotation, centerX, centerY), 
                m.scaleAt(scaling, centerX, centerY), 
                m.translate(translateX, translateY)
            ]);
        }
    };
    

    EDIT: To add mouse DnD support add the following code to the aforementioned:

    var moveable = new Moveable(g);   // require("dojox/gfx/Moveable")
    moveable.onMoved = function(mover, shift) {
        xSpinner.set("value", xSpinner.get("value") + shift.dx);
        ySpinner.set("value", ySpinner.get("value") + shift.dy);
    }
    

    Of course, you do not have to use NumberSpinner, but since I put it there before it gives you a nice feedback what is going on behind the scenes. See it at jsFiddle: http://jsfiddle.net/phusick/ta65D/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to rotate out an innoDB table which has a high number
I'm attempting to rotate a MovieClip by a fixed amount in degrees it has
I'm trying to rotate and revolve a Raphael shape simultaneously. Here's what I've tried
I am attempting to rotate some text within a label. I have a cusom
I have a function which rotates a slide show like startChangeImage(),My slideshow has to
I want to rotate my own FrameLayout in 3d in android. Do i have
I am using glm::rotate to rotate a transformation matrix for a cube in a
I am trying to rotate a vector of elements in C++. What I mean
I am trying to rotate image single round from it's center point but I
I want to rotate the log like in mySQL, but now for an H2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.