Threaded View
-
8 Apr 2011 3:11 AM #1
[B2] Gradients not working when I extend Ext.draw.Component
[B2] Gradients not working when I extend Ext.draw.Component
When I to add gradients to my extended class from Ext.draw.Sprite it always crashes in internet explorer.
Here is my extended class:
But when I just create an instance of the Ext.draw.Component is does not crash and shows the gradient:Code:Ext.define('Editor.Layout.Surface', { extend: 'Ext.draw.Component', viewBox: false, gradients: [{ id: 'blackblue', viewBox: true, angle: 90, stops: { 0: { color: 'rgb(33, 33, 33)' }, 100: { color: 'rgb(156, 178, 248)' } } }] }); lSurface = Ext.create('Editor.Layout.Surface', {});
The error message:Code:lSurface = Ext.create('Ext.draw.Component', { viewBox: false, gradients: [{ id: 'blackblue', viewBox: true, angle: 90, stops: { 0: { color: 'rgb(33, 33, 33)' }, 100: { color: 'rgb(156, 178, 248)' } } }] });
on this line:'gradientsCall' is empty or no object
If you like a testcase:Code:if (fillUrl.charAt(0) == "#") { gradient = me.gradientsColl.getByKey(fillUrl.substring(1)); }
The 2 different methods are in there, you can see that the content of the defined class is the exact same as the instance of the component.Code:Ext.onReady(function () { // Test with the extended class: Ext.define('Canvas', { extend: 'Ext.draw.Component', viewBox: false, gradients: [{ id: 'blackblue', angle: 45, stops: { 0: { color: 'rgb(33, 33, 33)' }, 100: { color: 'rgb(156, 178, 248)' } } }] }); var canvas = Ext.create('Canvas'); //Test with the instance of Ext.draw.Component: // var canvas = Ext.create('Ext.draw.Component', { // viewBox: false, // gradients: [{ // id: 'blackblue', // angle: 45, // stops: { // 0: { // color: 'rgb(33, 33, 33)' // }, // 100: { // color: 'rgb(156, 178, 248)' // } // } // }] // }); Ext.define('Test.Control.Event', { extend: 'Ext.draw.Sprite', constructor: function () { this.callParent([{ type: 'circle', x: 150, y: 150, radius: 100, fill: 'url(#blackblue)', stroke: '#000', surface: canvas.surface }]); } }); //create a window to place the draw component in Ext.create('Ext.Window', { width: 1000, height: 500, layout: 'fit', items: [canvas] }).show(); s = canvas.surface.add(new Test.Control.Event()); s.show(true); });
Is this a bug or am I extending whrong?
You found a bug! We've classified it as
EXTJSIV-831
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
Similar Threads
-
[CLOSED-EXTJSIV-800] Ext.draw.Component is not rotating in IE
By vega109 in forum Ext:BugsReplies: 4Last Post: 10 Apr 2011, 7:33 AM -
[OPEN-EXTJSIV-572][B1] Draw Component misses filters
By steffenk in forum Ext:BugsReplies: 3Last Post: 1 Apr 2011, 12:22 AM -
[FIXED-EXTJSIV-445] Ext.draw.Component: Render Items Config not rendered right
By Nickname in forum Ext:BugsReplies: 5Last Post: 29 Mar 2011, 8:45 AM -
[PR4] [VML][FIXED-EXTJSIV-163] Crash when I draw more than 27 draw.Components
By johanhaest in forum Ext:BugsReplies: 1Last Post: 18 Mar 2011, 9:35 AM -
[OPEN-EXTJSIV-157] Ext.draw.Component viewbox issue
By 4CastRisk in forum Ext:BugsReplies: 1Last Post: 17 Mar 2011, 4:16 PM


Reply With Quote