-
28 Mar 2011 11:34 PM #1
[FIXED-EXTJSIV-445] Ext.draw.Component: Render Items Config not rendered right
[FIXED-EXTJSIV-445] Ext.draw.Component: Render Items Config not rendered right
Hi,
didn't find any matching bug, so opening a new one:
Using the SVG Tiger Example, removed items config and replaced it with a simple circle config
Result:
Circle is fit into the Ext.draw.Component instead of using the configured x,y,radius
Expected Result:
From the example code below: A circle should be placed with center point at [100,100] and a radius of 30
Workaround:PHP Code:var cmp = Ext.create('Ext.draw.Component', {
width: 400,
height: 400,
draggable: {
constrain: true
},
floating: true,
renderTo: Ext.getBody(),
items: [{
type: "circle",
x: 100,
y: 100,
radius: 30,
stroke:"#000",
fill:"#fff"
}]
});
Don't configure items and add them later to the surface
PHP Code:// now create the circle
// now create the circle
var circle = cmp.surface.add(Ext.create('Ext.draw.Sprite', {
type: "circle",
x: 100,
y: 100,
radius: 30,
stroke:"#000",
fill:"#fff",
surface: cmp.surface // <-- Need to add surface, even if we add an item to a surface?!
}));
circle.show(true); // and show it
Edit:
Thread title is not good, should be something like "Rendering primitives from items config". sorry.
I cannot change it.
-
29 Mar 2011 12:09 AM #2
Try setting viewBox: false in your draw.Component.
This should fix your problem normally. I've had this problem too where it streches the items in your surface to fill the surface completely. When I added them like you this was indeed fixed.
But the viewBox on false seems to work aswell.
-
29 Mar 2011 12:22 AM #3
Thank you. Problem solved.
I read the JsDoc for the 'viewBox', but I didn't expect that it will overwrite a defined parameter like radius for circles and width/height for rectangles. I thought it will scale, if this informations are missing it will scale.
PHP Code:/**
* @cfg {Boolean} viewBox
* Turn on view box support which will scale and position items in the draw component to fit to the component while
* maintaining aspect ratio. Defaults to true.
*/
viewBox: true,
-
29 Mar 2011 8:06 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
I'll change the documentation to be more clear.
-
29 Mar 2011 8:41 AM #5
and maybe set it to false by default? This setting is something you should activate on need, not deactivate.
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
29 Mar 2011 8:45 AM #6Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
We may change this before release it's gone back and forth a couple times during development...
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED-EXTJSIV-191] Component.js typos
By LesJ in forum Ext:BugsReplies: 1Last Post: 21 Mar 2011, 3:12 PM -
[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 -
[OPEN] [FIXED][3.0] html config processed incorrectly in Component.render
By Animal in forum Ext 3.x: BugsReplies: 3Last Post: 5 Oct 2009, 3:02 PM -
[FIXED] Component.removeStyleName(...) doesn't works for not rendered component
By Alex.Leshkin in forum Ext GWT: Bugs (1.x)Replies: 2Last Post: 10 Sep 2008, 11:50 PM


Reply With Quote