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 8689869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:45:55+00:00 2026-06-12T23:45:55+00:00

I have these 4 rectangles and each rectangle has some amount of rotation transformation

  • 0

I have these 4 rectangles and each rectangle has some amount of rotation transformation applied to it. I put all these rectangles in a set and then applied transformation on it. Doing so the rotation transformation on the individual rectangles was lost. I do not want that to happen. How can I work around this?

JS Fiddle Code

window.onload = function(){
    var paper = Raphael(0,0,500,500);

    var rect01 = paper.set();
    paper.setStart();      

    var a = paper.rect(10,10,50,10).transform("r10");
    var b = paper.rect(10,30,50,10).transform("r-10");
    var c = paper.rect(10,50,50,10).transform("r10");
    var d = paper.rect(10,70,50,10).transform("r-10");

    var rect01 = paper.setFinish();    
    rect01.transform("t100,100");//comment out this line to view the individual transformations

}
  • 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-12T23:45:56+00:00Added an answer on June 12, 2026 at 11:45 pm

    Whenever you do a new transform on an element it resets any previous transforms, I’m sure there are numerous ways to achieve what you want, one way would be to just do the move at the same time as the rotation.

    NOTE: In your case you have to do the move before the rotation.

    window.onload = function(){
        var paper = Raphael(0,0,500,500);    
    
        var a = paper.rect(10,10,50,10).transform("t100,100r10");
        var b = paper.rect(10,30,50,10).transform("t100,100r-10");
        var c = paper.rect(10,50,50,10).transform("t100,100r10");
        var d = paper.rect(10,70,50,10).transform("t100,100r-10");
    
    }
    

    http://jsfiddle.net/Vqn93/2/

    UPDATE:

    After further analysis you are able to append and prepend transformations, so if you want to keep your set as you had it you can also do:

    window.onload = function(){
        var paper = Raphael(0,0,500,500);
    
        var rect01 = paper.set();
        paper.setStart();      
    
        var a = paper.rect(10,10,50,10).transform("r10");
        var b = paper.rect(10,30,50,10).transform("r-10");
        var c = paper.rect(10,50,50,10).transform("r10");
        var d = paper.rect(10,70,50,10).transform("r-10");
    
        var rect01 = paper.setFinish();
    
        // prepend the translation before all the rotations
        rect01.transform("t100,100...");
    

    }

    The docs for element transform state that you use … before or after depending on if you want to prepend or append.

    http://jsfiddle.net/Vqn93/3/

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

Sidebar

Related Questions

We have a pool of items. Each item has a set of characteristics. Each
I have a vector represented by the slope m. Then there is rectangle (assume
I have these objects: public class Class { public Guid Id {get;set;} public string
In my C# software, I have a number of drawing tools. Each tool has
I have a grid view, and I want to draw rectangles inside each cell
I have set of rectangles ( QGraphicsRectItem in QGraphicsScene ) whose X positions are
I have five combo boxes. Each one has a different name, but the possible
I have a JPanel on which I've painted four rectangles. The color for each
I have these 3 tables: and I'm using this code to join them together
I have these three lists with the same number of elements List<String>competitoinsIDs = new

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.