AS3SVGRenderer icon indicating copy to clipboard operation
AS3SVGRenderer copied to clipboard

cubicCurveTo available but not working in drawing of Path element

Open markviewbix opened this issue 8 years ago • 1 comments

I apologize in advance for the vagueness of this question. I'm hoping the phenomenon will trigger some possible clue to the solution but if it doesn't, I'll augment this question with more specific details and links later on (once my site is visible publicly from the internet).

I have used as3svgrenderer in my flash project to render icons and it's working great! I have one specific situation where the path elements are either not rendering at all, or are only partially rendering. Here is a sample svg:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="info" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
<style type="text/css">
    .background{fill:#0BAEDA;}
    .st0{fill:#FFFFFF;}
</style>
<rect class="background" width="40" height="40"/>
<ellipse class="st0" cx="24.5" cy="7.8" rx="3.5" ry="3.6"/>
<path class="st0" d="M13,30.8c0,0,4.5-12.1,5.1-13.2c0,0,0.6-2.4-1.8-0.7L13.4,20c0,0-1.5,1.2-1.3-0.8c0,0,2.3-3.3,6-5.4
    c0,0,5.7-2.5,6.9,1.1c0,0,0.8,0.8-1.2,6.2l-3.3,8.6c0,0-0.8,2.8,0.9,1.6l1-0.8l2-2c0,0,1.6-2.2,1.6-0.1c0,0-0.1,1.4-4.4,4.9
    c0,0-3.1,3-7.3,2.1C14.4,35.4,11.9,34.8,13,30.8z"/>
</svg>

In this example, the rect and ellipse elements render beautifully. The path doesn't render at all. As I said above, this happens when my flash player is loaded in a google VAST Inspector (https://developers.google.com/interactive-media-ads/docs/sdks/flash/vastinspector). My code is not yet public on the internet so I can't provide links to the phenomenon but I'm attaching two screen captures of the same application, one loaded directly from the browser and the other loaded from within the Google VAST inspector. The svg icon I referred to earlier in this message appears in the two screen captures inside the bottom-most yellow circle.

Can you think of any reason why this might be happening?

screenhunter_45 aug 04 11 07

screenhunter_44 aug 04 11 04

markviewbix avatar Aug 04 '16 08:08 markviewbix

I did some more digging and found where the issue occurs. In GraphicsPathDrawer.as there is a method called: cubicCurveTo. At the beginning of that function, there is a call to FlashPlayerUtils.supportsCubicCurves which checks to see if the system supports the "cubicCurveTo" method. If it does, it uses the cubicCurveTo method. Otherwise, it converts the cubic curve to a quadratic curve.

In my two cases (depicted above in the two screen captures), the first case supports the cubicCurveTo method and fails in the drawing. The second case doesn't support it so the drawing succeeds. I haven't figured out why in the case of the Google VAST inspector, it would think that it supports cubicCurveTo but in a regular Chrome browser it wouldn't. Perhaps you can offer a suggestion?

If I change supportsCubicCurves to always return false, the drawing works.

markviewbix avatar Aug 04 '16 12:08 markviewbix