Book a Demo

Author Topic: Shapescript can't draw correctly  (Read 3232 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Shapescript can't draw correctly
« on: November 11, 2019, 10:22:11 am »
Nothing new, just another bug. Or maybe I'm just stupid. Here's my decoration which shall draw an exclamation mark:

Code: [Select]
decoration exclamation {
  orientation = "NE";
  noShadow = true;
  SetFillColor(0,0,0);
  StartPath();
  MoveTo(50, 70);
  LineTo(60, 0);
  LineTo(40, 0);
  LineTo(50, 70);
  EndPath();
  FillAndStrokePath();
  Ellipse(46, 80, 54, 100);
}

Looks ok in the preview window, but when you look at the actual decoration, the dot is remarkably left to the center. Looks like the wind has blown it away.

"Adjusting" the ellipse to
Code: [Select]
  Ellipse(48, 80, 56, 100);
looks odd in the preview but yields a seemingly correct exclamation mark in the decoration.

Now who's weird here?

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shapescript can't draw correctly
« Reply #1 on: November 11, 2019, 10:33:11 am »
Been there, done that, bought the book.  Actually I haven't bought your shapescript book, but it should mention that drawing ellipses in shapescripts is problematic

I've encountered many such issues.  I just keep fiddling until the output on the screen looks right.  As you change the zoom, that can also muck things up and other shapes aren't immune either.

Sympathy,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shapescript can't draw correctly
« Reply #2 on: November 11, 2019, 10:34:45 am »
Yeah, I have a collection of weirdnesses in the book. I might add that one too...

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Shapescript can't draw correctly
« Reply #3 on: November 12, 2019, 12:56:43 am »
Not to pile on, or actually, exactly to pile on, I've noticed that simple geometric shapes like triangles in decorations (drawn with three line segments and a fill) get distorted depending on their placement in the diagram.

!

!!


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shapescript can't draw correctly
« Reply #4 on: November 12, 2019, 01:11:17 am »
Yes, I noticed that too. Tried noShade=true but that made no difference. As always: try something else until it (somehow) fits your needs.

q.