gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Problem with Drawing API


From: Udo Giacomozzi
Subject: [Gnash-dev] Problem with Drawing API
Date: Mon, 5 Nov 2007 19:15:03 +0100

The new point_test algorithm fails one test in the DrawingApiTest:

  DrawingApiTestRunner.cpp:118

This is because the constructed shape definition is malformed. The
cyan-fill square (DrawingApiTest.as:148) is drawn clock-wise:

  // The clockwise blue-stroke, cyan-fill square
  moveTo(200, 100);
  lineStyle(1, 0x00FF00);
  beginFill(0x00FFFF, 100);
  lineTo(200, 120);
  lineTo(180, 120);
  lineTo(180, 100);
  lineTo(200, 100);
  endFill();

(BTW, it has a green stroke...)

However, the the resulting path has it's left fill style set (1) and
it's right fill style not set (0). This would mean the square is
filled outside, but not inside (the opposite).

DynamicShape::startNewPath() blindly sets the left fill style for the
path, which is a problem. Honestly I also don't know how to choose
correct fill style side.

The renderers seem to handle this in some way (but that's probably
just luck), but point_test has problems with this (it never returns
true).

Any idea how we could solve this problem?

I see another "problem" when drawing this figure in ActionScript:


             2       0
             | \   / |
             |  \ /  |
             |   X   |
             |  / \  |
             | /   \ |
             3       1

In theory this shape must be normalized to have a correct definition,
which would look like this:

             4       0
             | \   / |
             |  \ /  |
             |   5   |
             |   2   |
             |  / \  |
             | /   \ |
             3       1

We don't do this currently but the renderers (at least AGG, didn't
check others) have no problem with it.

We could just ignore this error, but I dunno how to fix point_test for
these violations... Problem...


Udo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]