Sprite2.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-draw-Sprite'>/**
  19. </span> * A Sprite is an object rendered in a Drawing surface.
  20. *
  21. * ## Types
  22. *
  23. * The following sprite types are supported:
  24. *
  25. * ### Rect
  26. *
  27. * Rectangle requires `width` and `height` attributes:
  28. *
  29. * @example
  30. * Ext.create('Ext.draw.Component', {
  31. * renderTo: Ext.getBody(),
  32. * width: 200,
  33. * height: 200,
  34. * items: [{
  35. * type: 'rect',
  36. * width: 100,
  37. * height: 50,
  38. * radius: 10,
  39. * fill: 'green',
  40. * opacity: 0.5,
  41. * stroke: 'red',
  42. * 'stroke-width': 2
  43. * }]
  44. * });
  45. *
  46. * ### Circle
  47. *
  48. * Circle requires `x`, `y` and `radius` attributes:
  49. *
  50. * @example
  51. * Ext.create('Ext.draw.Component', {
  52. * renderTo: Ext.getBody(),
  53. * width: 200,
  54. * height: 200,
  55. * items: [{
  56. * type: 'circle',
  57. * radius: 90,
  58. * x: 100,
  59. * y: 100,
  60. * fill: 'blue',
  61. * }]
  62. * });
  63. *
  64. * ### Ellipse
  65. *
  66. * Ellipse requires `x`, `y`, `radiusX` and `radiusY` attributes:
  67. *
  68. * @example
  69. * Ext.create('Ext.draw.Component', {
  70. * renderTo: Ext.getBody(),
  71. * width: 200,
  72. * height: 200,
  73. * items: [{
  74. * type: &quot;ellipse&quot;,
  75. * radiusX: 100,
  76. * radiusY: 50,
  77. * x: 100,
  78. * y: 100,
  79. * fill: 'red'
  80. * }]
  81. * });
  82. *
  83. * ### Path
  84. *
  85. * Path requires the `path` attribute:
  86. *
  87. * @example
  88. * Ext.create('Ext.draw.Component', {
  89. * renderTo: Ext.getBody(),
  90. * width: 200,
  91. * height: 200,
  92. * items: [{
  93. * type: &quot;path&quot;,
  94. * path: &quot;M-66.6 26C-66.6 26 -75 22 -78.2 18.4C-81.4 14.8 -80.948 19.966 &quot; +
  95. * &quot;-85.8 19.6C-91.647 19.159 -90.6 3.2 -90.6 3.2L-94.6 10.8C-94.6 &quot; +
  96. * &quot;10.8 -95.8 25.2 -87.8 22.8C-83.893 21.628 -82.6 23.2 -84.2 &quot; +
  97. * &quot;24C-85.8 24.8 -78.6 25.2 -81.4 26.8C-84.2 28.4 -69.8 23.2 -72.2 &quot; +
  98. * &quot;33.6L-66.6 26z&quot;,
  99. * fill: &quot;purple&quot;
  100. * }]
  101. * });
  102. *
  103. * ### Text
  104. *
  105. * Text requires the `text` attribute:
  106. *
  107. * @example
  108. * Ext.create('Ext.draw.Component', {
  109. * renderTo: Ext.getBody(),
  110. * width: 200,
  111. * height: 200,
  112. * items: [{
  113. * type: &quot;text&quot;,
  114. * text: &quot;Hello, Sprite!&quot;,
  115. * fill: &quot;green&quot;,
  116. * font: &quot;18px monospace&quot;
  117. * }]
  118. * });
  119. *
  120. * ### Image
  121. *
  122. * Image requires `width`, `height` and `src` attributes:
  123. *
  124. * @example
  125. * Ext.create('Ext.draw.Component', {
  126. * renderTo: Ext.getBody(),
  127. * width: 200,
  128. * height: 200,
  129. * items: [{
  130. * type: &quot;image&quot;,
  131. * src: &quot;http://www.sencha.com/img/apple-touch-icon.png&quot;,
  132. * width: 200,
  133. * height: 200
  134. * }]
  135. * });
  136. *
  137. * ## Creating and adding a Sprite to a Surface
  138. *
  139. * See {@link Ext.draw.Surface} documentation.
  140. *
  141. * ## Transforming sprites
  142. *
  143. * See {@link #setAttributes} method documentation for examples on how to translate, scale and rotate the sprites.
  144. *
  145. */
  146. Ext.define('Ext.draw.Sprite', {
  147. /* Begin Definitions */
  148. mixins: {
  149. observable: 'Ext.util.Observable',
  150. animate: 'Ext.util.Animate'
  151. },
  152. requires: ['Ext.draw.SpriteDD'],
  153. /* End Definitions */
  154. <span id='Ext-draw-Sprite-cfg-type'> /**
  155. </span> * @cfg {String} type The type of the sprite.
  156. * Possible options are 'circle', 'ellipse', 'path', 'rect', 'text', 'image'.
  157. *
  158. * See {@link Ext.draw.Sprite} class documentation for examples of all types.
  159. */
  160. <span id='Ext-draw-Sprite-cfg-width'> /**
  161. </span> * @cfg {Number} width The width of the rect or image sprite.
  162. */
  163. <span id='Ext-draw-Sprite-cfg-height'> /**
  164. </span> * @cfg {Number} height The height of the rect or image sprite.
  165. */
  166. <span id='Ext-draw-Sprite-cfg-radius'> /**
  167. </span> * @cfg {Number} radius The radius of the circle sprite. Or in case of rect sprite, the border radius.
  168. */
  169. <span id='Ext-draw-Sprite-cfg-radiusX'> /**
  170. </span> * @cfg {Number} radiusX The radius of the ellipse sprite along x-axis.
  171. */
  172. <span id='Ext-draw-Sprite-cfg-radiusY'> /**
  173. </span> * @cfg {Number} radiusY The radius of the ellipse sprite along y-axis.
  174. */
  175. <span id='Ext-draw-Sprite-cfg-x'> /**
  176. </span> * @cfg {Number} x Sprite position along the x-axis.
  177. */
  178. <span id='Ext-draw-Sprite-cfg-y'> /**
  179. </span> * @cfg {Number} y Sprite position along the y-axis.
  180. */
  181. <span id='Ext-draw-Sprite-cfg-path'> /**
  182. </span> * @cfg {String} path The path of the path sprite written in SVG-like path syntax.
  183. */
  184. <span id='Ext-draw-Sprite-cfg-opacity'> /**
  185. </span> * @cfg {Number} opacity The opacity of the sprite. A number between 0 and 1.
  186. */
  187. <span id='Ext-draw-Sprite-cfg-fill'> /**
  188. </span> * @cfg {String} fill The fill color.
  189. */
  190. <span id='Ext-draw-Sprite-cfg-stroke'> /**
  191. </span> * @cfg {String} stroke The stroke color.
  192. */
  193. <span id='Ext-draw-Sprite-cfg-stroke-width'> /**
  194. </span> * @cfg {Number} stroke-width The width of the stroke.
  195. *
  196. * Note that this attribute needs to be quoted when used. Like so:
  197. *
  198. * &quot;stroke-width&quot;: 12,
  199. */
  200. <span id='Ext-draw-Sprite-cfg-font'> /**
  201. </span> * @cfg {String} font Used with text type sprites. The full font description.
  202. * Uses the same syntax as the CSS font parameter
  203. */
  204. <span id='Ext-draw-Sprite-cfg-text'> /**
  205. </span> * @cfg {String} text The actual text to render in text sprites.
  206. */
  207. <span id='Ext-draw-Sprite-cfg-src'> /**
  208. </span> * @cfg {String} src Path to the image to show in image sprites.
  209. */
  210. <span id='Ext-draw-Sprite-cfg-group'> /**
  211. </span> * @cfg {String/String[]} group The group that this sprite belongs to, or an array of groups.
  212. * Only relevant when added to a {@link Ext.draw.Surface Surface}.
  213. */
  214. <span id='Ext-draw-Sprite-cfg-draggable'> /**
  215. </span> * @cfg {Boolean} draggable True to make the sprite draggable.
  216. */
  217. dirty: false,
  218. dirtyHidden: false,
  219. dirtyTransform: false,
  220. dirtyPath: true,
  221. dirtyFont: true,
  222. zIndexDirty: true,
  223. <span id='Ext-draw-Sprite-property-isSprite'> /**
  224. </span> * @property {Boolean} isSprite
  225. * `true` in this class to identify an object as an instantiated Sprite, or subclass thereof.
  226. */
  227. isSprite: true,
  228. zIndex: 0,
  229. fontProperties: [
  230. 'font',
  231. 'font-size',
  232. 'font-weight',
  233. 'font-style',
  234. 'font-family',
  235. 'text-anchor',
  236. 'text'
  237. ],
  238. pathProperties: [
  239. 'x',
  240. 'y',
  241. 'd',
  242. 'path',
  243. 'height',
  244. 'width',
  245. 'radius',
  246. 'r',
  247. 'rx',
  248. 'ry',
  249. 'cx',
  250. 'cy'
  251. ],
  252. constructor: function(config) {
  253. var me = this;
  254. config = Ext.merge({}, config || {});
  255. me.id = Ext.id(null, 'ext-sprite-');
  256. me.transformations = [];
  257. Ext.copyTo(this, config, 'surface,group,type,draggable');
  258. //attribute bucket
  259. me.bbox = {};
  260. me.attr = {
  261. zIndex: 0,
  262. translation: {
  263. x: null,
  264. y: null
  265. },
  266. rotation: {
  267. degrees: null,
  268. x: null,
  269. y: null
  270. },
  271. scaling: {
  272. x: null,
  273. y: null,
  274. cx: null,
  275. cy: null
  276. }
  277. };
  278. //delete not bucket attributes
  279. delete config.surface;
  280. delete config.group;
  281. delete config.type;
  282. delete config.draggable;
  283. me.setAttributes(config);
  284. me.addEvents(
  285. <span id='Ext-draw-Sprite-event-beforedestroy'> /**
  286. </span> * @event
  287. * Fires before the sprite is destroyed. Return false from an event handler to stop the destroy.
  288. * @param {Ext.draw.Sprite} this
  289. */
  290. 'beforedestroy',
  291. <span id='Ext-draw-Sprite-event-destroy'> /**
  292. </span> * @event
  293. * Fires after the sprite is destroyed.
  294. * @param {Ext.draw.Sprite} this
  295. */
  296. 'destroy',
  297. <span id='Ext-draw-Sprite-event-render'> /**
  298. </span> * @event
  299. * Fires after the sprite markup is rendered.
  300. * @param {Ext.draw.Sprite} this
  301. */
  302. 'render',
  303. <span id='Ext-draw-Sprite-event-mousedown'> /**
  304. </span> * @event
  305. * @inheritdoc Ext.dom.Element#mousedown
  306. */
  307. 'mousedown',
  308. <span id='Ext-draw-Sprite-event-mouseup'> /**
  309. </span> * @event
  310. * @inheritdoc Ext.dom.Element#mouseup
  311. */
  312. 'mouseup',
  313. <span id='Ext-draw-Sprite-event-mouseover'> /**
  314. </span> * @event
  315. * @inheritdoc Ext.dom.Element#mouseover
  316. */
  317. 'mouseover',
  318. <span id='Ext-draw-Sprite-event-mouseout'> /**
  319. </span> * @event
  320. * @inheritdoc Ext.dom.Element#mouseout
  321. */
  322. 'mouseout',
  323. <span id='Ext-draw-Sprite-event-mousemove'> /**
  324. </span> * @event
  325. * @inheritdoc Ext.dom.Element#mousemove
  326. */
  327. 'mousemove',
  328. <span id='Ext-draw-Sprite-event-click'> /**
  329. </span> * @event
  330. * @inheritdoc Ext.dom.Element#click
  331. */
  332. 'click'
  333. );
  334. me.mixins.observable.constructor.apply(this, arguments);
  335. },
  336. <span id='Ext-draw-Sprite-property-dd'> /**
  337. </span> * @property {Ext.dd.DragSource} dd
  338. * If this Sprite is configured {@link #draggable}, this property will contain
  339. * an instance of {@link Ext.dd.DragSource} which handles dragging the Sprite.
  340. *
  341. * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}
  342. * in order to supply behaviour for each stage of the drag/drop process. See {@link #draggable}.
  343. */
  344. initDraggable: function() {
  345. var me = this;
  346. me.draggable = true;
  347. //create element if it doesn't exist.
  348. if (!me.el) {
  349. me.surface.createSpriteElement(me);
  350. }
  351. me.dd = new Ext.draw.SpriteDD(me, Ext.isBoolean(me.draggable) ? null : me.draggable);
  352. me.on('beforedestroy', me.dd.destroy, me.dd);
  353. },
  354. <span id='Ext-draw-Sprite-method-setAttributes'> /**
  355. </span> * Change the attributes of the sprite.
  356. *
  357. * ## Translation
  358. *
  359. * For translate, the configuration object contains x and y attributes that indicate where to
  360. * translate the object. For example:
  361. *
  362. * sprite.setAttributes({
  363. * translate: {
  364. * x: 10,
  365. * y: 10
  366. * }
  367. * }, true);
  368. *
  369. *
  370. * ## Rotation
  371. *
  372. * For rotation, the configuration object contains x and y attributes for the center of the rotation (which are optional),
  373. * and a `degrees` attribute that specifies the rotation in degrees. For example:
  374. *
  375. * sprite.setAttributes({
  376. * rotate: {
  377. * degrees: 90
  378. * }
  379. * }, true);
  380. *
  381. * That example will create a 90 degrees rotation using the centroid of the Sprite as center of rotation, whereas:
  382. *
  383. * sprite.setAttributes({
  384. * rotate: {
  385. * x: 0,
  386. * y: 0,
  387. * degrees: 90
  388. * }
  389. * }, true);
  390. *
  391. * will create a rotation around the `(0, 0)` axis.
  392. *
  393. *
  394. * ## Scaling
  395. *
  396. * For scaling, the configuration object contains x and y attributes for the x-axis and y-axis scaling. For example:
  397. *
  398. * sprite.setAttributes({
  399. * scale: {
  400. * x: 10,
  401. * y: 3
  402. * }
  403. * }, true);
  404. *
  405. * You can also specify the center of scaling by adding `cx` and `cy` as properties:
  406. *
  407. * sprite.setAttributes({
  408. * scale: {
  409. * cx: 0,
  410. * cy: 0,
  411. * x: 10,
  412. * y: 3
  413. * }
  414. * }, true);
  415. *
  416. * That last example will scale a sprite taking as centers of scaling the `(0, 0)` coordinate.
  417. *
  418. * @param {Object} attrs attributes to be changed on the sprite.
  419. * @param {Boolean} redraw Flag to immediately draw the change.
  420. * @return {Ext.draw.Sprite} this
  421. */
  422. setAttributes: function(attrs, redraw) {
  423. var me = this,
  424. fontProps = me.fontProperties,
  425. fontPropsLength = fontProps.length,
  426. pathProps = me.pathProperties,
  427. pathPropsLength = pathProps.length,
  428. hasSurface = !!me.surface,
  429. custom = hasSurface &amp;&amp; me.surface.customAttributes || {},
  430. spriteAttrs = me.attr,
  431. dirtyBBox = false,
  432. attr, i, newTranslation, translation, newRotate, rotation, newScaling, scaling;
  433. attrs = Ext.apply({}, attrs);
  434. for (attr in custom) {
  435. if (attrs.hasOwnProperty(attr) &amp;&amp; typeof custom[attr] == &quot;function&quot;) {
  436. Ext.apply(attrs, custom[attr].apply(me, [].concat(attrs[attr])));
  437. }
  438. }
  439. // Flag a change in hidden
  440. if (!!attrs.hidden !== !!spriteAttrs.hidden) {
  441. me.dirtyHidden = true;
  442. }
  443. // Flag path change
  444. for (i = 0; i &lt; pathPropsLength; i++) {
  445. attr = pathProps[i];
  446. if (attr in attrs &amp;&amp; attrs[attr] !== spriteAttrs[attr]) {
  447. me.dirtyPath = true;
  448. dirtyBBox = true;
  449. break;
  450. }
  451. }
  452. // Flag zIndex change
  453. if ('zIndex' in attrs) {
  454. me.zIndexDirty = true;
  455. }
  456. // Flag font/text change
  457. if ('text' in attrs) {
  458. me.dirtyFont = true;
  459. dirtyBBox = true;
  460. }
  461. for (i = 0; i &lt; fontPropsLength; i++) {
  462. attr = fontProps[i];
  463. if (attr in attrs &amp;&amp; attrs[attr] !== spriteAttrs[attr]) {
  464. me.dirtyFont = true;
  465. dirtyBBox = true;
  466. break;
  467. }
  468. }
  469. newTranslation = attrs.translation || attrs.translate;
  470. delete attrs.translate;
  471. delete attrs.translation;
  472. translation = spriteAttrs.translation;
  473. if (newTranslation) {
  474. if (('x' in newTranslation &amp;&amp; newTranslation.x !== translation.x) ||
  475. ('y' in newTranslation &amp;&amp; newTranslation.y !== translation.y)) {
  476. me.dirtyTransform = true;
  477. translation.x = newTranslation.x;
  478. translation.y = newTranslation.y;
  479. }
  480. }
  481. newRotate = attrs.rotation || attrs.rotate;
  482. rotation = spriteAttrs.rotation;
  483. delete attrs.rotate;
  484. delete attrs.rotation;
  485. if (newRotate) {
  486. if (('x' in newRotate &amp;&amp; newRotate.x !== rotation.x) ||
  487. ('y' in newRotate &amp;&amp; newRotate.y !== rotation.y) ||
  488. ('degrees' in newRotate &amp;&amp; newRotate.degrees !== rotation.degrees)) {
  489. me.dirtyTransform = true;
  490. rotation.x = newRotate.x;
  491. rotation.y = newRotate.y;
  492. rotation.degrees = newRotate.degrees;
  493. }
  494. }
  495. newScaling = attrs.scaling || attrs.scale;
  496. scaling = spriteAttrs.scaling;
  497. delete attrs.scale;
  498. delete attrs.scaling;
  499. if (newScaling) {
  500. if (('x' in newScaling &amp;&amp; newScaling.x !== scaling.x) ||
  501. ('y' in newScaling &amp;&amp; newScaling.y !== scaling.y) ||
  502. ('cx' in newScaling &amp;&amp; newScaling.cx !== scaling.cx) ||
  503. ('cy' in newScaling &amp;&amp; newScaling.cy !== scaling.cy)) {
  504. me.dirtyTransform = true;
  505. scaling.x = newScaling.x;
  506. scaling.y = newScaling.y;
  507. scaling.cx = newScaling.cx;
  508. scaling.cy = newScaling.cy;
  509. }
  510. }
  511. // If the bbox is changed, then the bbox based transforms should be invalidated.
  512. if (!me.dirtyTransform &amp;&amp; dirtyBBox) {
  513. if (spriteAttrs.scaling.x === null ||
  514. spriteAttrs.scaling.y === null ||
  515. spriteAttrs.rotation.y === null ||
  516. spriteAttrs.rotation.y === null) {
  517. me.dirtyTransform = true;
  518. }
  519. }
  520. Ext.apply(spriteAttrs, attrs);
  521. me.dirty = true;
  522. if (redraw === true &amp;&amp; hasSurface) {
  523. me.redraw();
  524. }
  525. return this;
  526. },
  527. <span id='Ext-draw-Sprite-method-getBBox'> /**
  528. </span> * Retrieves the bounding box of the sprite.
  529. * This will be returned as an object with x, y, width, and height properties.
  530. * @return {Object} bbox
  531. */
  532. getBBox: function() {
  533. return this.surface.getBBox(this);
  534. },
  535. setText: function(text) {
  536. return this.surface.setText(this, text);
  537. },
  538. <span id='Ext-draw-Sprite-method-hide'> /**
  539. </span> * Hides the sprite.
  540. * @param {Boolean} redraw Flag to immediately draw the change.
  541. * @return {Ext.draw.Sprite} this
  542. */
  543. hide: function(redraw) {
  544. this.setAttributes({
  545. hidden: true
  546. }, redraw);
  547. return this;
  548. },
  549. <span id='Ext-draw-Sprite-method-show'> /**
  550. </span> * Shows the sprite.
  551. * @param {Boolean} redraw Flag to immediately draw the change.
  552. * @return {Ext.draw.Sprite} this
  553. */
  554. show: function(redraw) {
  555. this.setAttributes({
  556. hidden: false
  557. }, redraw);
  558. return this;
  559. },
  560. <span id='Ext-draw-Sprite-method-remove'> /**
  561. </span> * Removes the sprite.
  562. * @return {Boolean} True if sprite was successfully removed.
  563. * False when there was no surface to remove it from.
  564. */
  565. remove: function() {
  566. if (this.surface) {
  567. this.surface.remove(this);
  568. return true;
  569. }
  570. return false;
  571. },
  572. onRemove: function() {
  573. this.surface.onRemove(this);
  574. },
  575. <span id='Ext-draw-Sprite-method-destroy'> /**
  576. </span> * Removes the sprite and clears all listeners.
  577. */
  578. destroy: function() {
  579. var me = this;
  580. if (me.fireEvent('beforedestroy', me) !== false) {
  581. me.remove();
  582. me.surface.onDestroy(me);
  583. me.clearListeners();
  584. me.fireEvent('destroy');
  585. }
  586. },
  587. <span id='Ext-draw-Sprite-method-redraw'> /**
  588. </span> * Redraws the sprite.
  589. * @return {Ext.draw.Sprite} this
  590. */
  591. redraw: function() {
  592. this.surface.renderItem(this);
  593. return this;
  594. },
  595. <span id='Ext-draw-Sprite-method-setStyle'> /**
  596. </span> * Wrapper for setting style properties, also takes single object parameter of multiple styles.
  597. * @param {String/Object} property The style property to be set, or an object of multiple styles.
  598. * @param {String} value (optional) The value to apply to the given property, or null if an object was passed.
  599. * @return {Ext.draw.Sprite} this
  600. */
  601. setStyle: function() {
  602. this.el.setStyle.apply(this.el, arguments);
  603. return this;
  604. },
  605. <span id='Ext-draw-Sprite-method-addCls'> /**
  606. </span> * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out. Note this method
  607. * is severly limited in VML.
  608. * @param {String/String[]} className The CSS class to add, or an array of classes
  609. * @return {Ext.draw.Sprite} this
  610. */
  611. addCls: function(obj) {
  612. this.surface.addCls(this, obj);
  613. return this;
  614. },
  615. <span id='Ext-draw-Sprite-method-removeCls'> /**
  616. </span> * Removes one or more CSS classes from the element.
  617. * @param {String/String[]} className The CSS class to remove, or an array of classes. Note this method
  618. * is severly limited in VML.
  619. * @return {Ext.draw.Sprite} this
  620. */
  621. removeCls: function(obj) {
  622. this.surface.removeCls(this, obj);
  623. return this;
  624. }
  625. });
  626. </pre>
  627. </body>
  628. </html>