Bug 18556 - Graphics.ScaleTransform and RotateTransform does not work properly
Summary: Graphics.ScaleTransform and RotateTransform does not work properly
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Drawing ()
Version: 3.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-03-24 14:39 UTC by AndrewStx
Modified: 2014-05-08 22:57 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Results from Mac and Windows (17.51 KB, image/jpeg)
2014-03-24 14:39 UTC, AndrewStx
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 18556 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description AndrewStx 2014-03-24 14:39:21 UTC
Created attachment 6400 [details]
Results from Mac and Windows

Graphics.ScaleTransform and RotateTransform does not provide expected results as in .Net. Output is wrong and unusable.
TranslateTransform works just fine. I tried 3.2.6 and 3.2.7. Results are the same.
Below is the code to reproduce and screenshots in the attachment:
    class Program
    {
        public static void Main(string[] args)
        {

            Application.Run(new TestForm());

        }

        public class TestForm : Form
        {
            public TestForm()
            {
                ClientSize = new Size(200, 200);

                Paint += (object sender, System.Windows.Forms.PaintEventArgs e) =>
            {
                Graphics g = e.Graphics;
                Rectangle r = new Rectangle(0, 0, 100, 50);

                g.TranslateTransform(50, 50);
                g.FillRectangle(Brushes.Red, r);


                g.RotateTransform(30f);
                g.FillRectangle(Brushes.Green, r);

                g.ScaleTransform(0.5f, 0.5f);
                g.FillRectangle(Brushes.Blue, r);

            };

            }
        }
    }
Comment 1 contact 2014-05-08 22:57:55 UTC
Doesn't work for me on Linux either (Mono 3.0.6). The result is slightly different though: the red and blue rectangles are drawn correctly, but the green rectangle is not drawn at all.