This is an automated email from the ASF dual-hosted git repository. carlosrovira pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push: new a8e291e be014: latest fixes for blog publication a8e291e is described below commit a8e291ea8ece4dd688015a4b12eeafe2c3d4099d Author: Carlos Rovira <carlosrov...@apache.org> AuthorDate: Sun Mar 29 17:44:28 2020 +0200 be014: latest fixes for blog publication --- .../src/main/resources/assets/bottle-shade.svg | 6 +++++ .../src/main/resources/bottle-perspective.afdesign | Bin 0 -> 116386 bytes .../src/main/resources/bottle.afdesign | Bin 64309 -> 67557 bytes .../main/royale/BE0014_Working_with_Graphics.mxml | 27 ++++++++++----------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/examples/blog/BE0014_Working_with_Graphics/src/main/resources/assets/bottle-shade.svg b/examples/blog/BE0014_Working_with_Graphics/src/main/resources/assets/bottle-shade.svg index 07be12d..f788f8a 100644 --- a/examples/blog/BE0014_Working_with_Graphics/src/main/resources/assets/bottle-shade.svg +++ b/examples/blog/BE0014_Working_with_Graphics/src/main/resources/assets/bottle-shade.svg @@ -18,6 +18,12 @@ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" viewBox="0 0 400 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"> <path id="inner" d="M369.259,461.074C372.421,467.275 372.131,474.674 368.493,480.609C364.856,486.544 358.395,490.161 351.434,490.158C281.717,490.133 118.985,490.075 48.865,490.05C41.86,490.048 35.367,486.381 31.748,480.384C28.129,474.386 27.911,466.933 31.174,460.735C66.451,393.714 150,234.984 150,234.984L150,40L255,40L254,235C254,235 335.14,394.151 369.259,461.074Z" style="fill:url(#_Radial1);"/> + <clipPath id="_clip2"> + <path d="M369.259,461.074C372.421,467.275 372.131,474.674 368.493,480.609C364.856,486.544 358.395,490.161 351.434,490.158C281.717,490.133 118.985,490.075 48.865,490.05C41.86,490.048 35.367,486.381 31.748,480.384C28.129,474.386 27.911,466.933 31.174,460.735C66.451,393.714 150,234.984 150,234.984L150,40L255,40L254,235C254,235 335.14,394.151 369.259,461.074Z"/> + </clipPath> + <g clip-path="url(#_clip2)"> + <path d="M170.955,77L194,77L194,245L81,467.049C81,467.049 48.173,471.562 56.009,459C64.639,445.166 171,241 171,241L170.955,77Z" style="fill:white;fill-opacity:0.35;"/> + </g> <path d="M369.259,461.074C372.421,467.275 372.131,474.674 368.493,480.609C364.856,486.544 358.395,490.161 351.434,490.158C281.717,490.133 118.985,490.075 48.865,490.05C41.86,490.048 35.367,486.381 31.748,480.384C28.129,474.386 27.911,466.933 31.174,460.735C66.451,393.714 150,234.984 150,234.984L150,40L255,40L254,235C254,235 335.14,394.151 369.259,461.074ZM244.949,50L160,50L160,234.984C160,236.607 159.605,238.206 158.849,239.642C158.849,239.642 75.3,398.371 40.023,465.392C38.392,468.4 [...] <defs> <radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(229.791,1.35475,-1.98413,336.545,205.755,161.944)"><stop offset="0" style="stop-color:white;stop-opacity:0.2"/><stop offset="0.43" style="stop-color:white;stop-opacity:0.34"/><stop offset="1" style="stop-color:white;stop-opacity:0.65"/></radialGradient> diff --git a/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle-perspective.afdesign b/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle-perspective.afdesign new file mode 100644 index 0000000..e4a0465 Binary files /dev/null and b/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle-perspective.afdesign differ diff --git a/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle.afdesign b/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle.afdesign index bf1b5ab..29e2ea8 100644 Binary files a/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle.afdesign and b/examples/blog/BE0014_Working_with_Graphics/src/main/resources/bottle.afdesign differ diff --git a/examples/blog/BE0014_Working_with_Graphics/src/main/royale/BE0014_Working_with_Graphics.mxml b/examples/blog/BE0014_Working_with_Graphics/src/main/royale/BE0014_Working_with_Graphics.mxml index 794eb7f..5148049 100644 --- a/examples/blog/BE0014_Working_with_Graphics/src/main/royale/BE0014_Working_with_Graphics.mxml +++ b/examples/blog/BE0014_Working_with_Graphics/src/main/royale/BE0014_Working_with_Graphics.mxml @@ -25,7 +25,7 @@ xmlns:graphics="org.apache.royale.graphics.*"> <fx:Script> - <![CDATA[ + <![CDATA[ import org.apache.royale.display.Graphics; import org.apache.royale.utils.transformValueFromRange; @@ -34,11 +34,10 @@ */ private var liquidColor:Number = 0x15CF12; - /** * Fill the bottle */ - private function changeFill(event:ValueChangeEvent):void { + private function changeFill(event:ValueChangeEvent):void { var g:Graphics = Graphics.getInstanceFor(bgShape); var newHeight:Number = transformValueFromRange(slider.value, slider.minimum, slider.maximum, 0, rule.height); var newY:Number = fgShape.height - newHeight; @@ -46,7 +45,7 @@ g.clear(); drawLiquid(g, liquidColor, .5, 0, newY, 400, 500, -15); drawLiquid(g, liquidColor, 1, 0, newY, 400, 500, 30); - } + } /** * Draw the liquid to fill the bottle @@ -64,9 +63,9 @@ g.lineTo(x, height); g.endFill(); } - ]]> - </fx:Script> - + ]]> + </fx:Script> + <j:beads> <js:ApplicationDataBinding/> </j:beads> @@ -80,8 +79,8 @@ <j:Card width="460" height="680"> <j:CardHeader> - <html:H3 text="Working with Graphics" className="primary-normal"/> - </j:CardHeader> + <html:H3 text="Working with vector graphics" className="primary-normal"/> + </j:CardHeader> <j:CardPrimaryContent itemsHorizontalAlign="itemsCentered"> <j:Container localId="fgShape" width="400" height="500"> @@ -90,7 +89,7 @@ <!-- rule --> <j:Group visible="{ruleVisibility.selected}"> - <svg:Rect localId="rule" x="180" y="{bgShape.height - rule.height}" width="6" height="350"> + <svg:Rect localId="rule" x="200" y="{bgShape.height - rule.height}" width="6" height="350"> <svg:fill> <js:SolidColor color="#ff0000" alpha=".5"/> </svg:fill> @@ -105,7 +104,7 @@ </j:Container> </j:CardPrimaryContent> - <j:CardActions itemsHorizontalAlign="itemsRight" itemsVerticalAlign="itemsCentered"> + <j:CardActions itemsHorizontalAlign="itemsRight" itemsVerticalAlign="itemsCentered"> <j:BarSection width="50%"> <j:ToggleButton localId="ruleVisibility" outlined="true" emphasis="emphasized" @@ -114,13 +113,13 @@ <js:ToggleFontIcon text="{MaterialIconType.VISIBILITY_OFF}" selectedText="{MaterialIconType.VISIBILITY}" material="true"/> </j:icon> </j:ToggleButton> - </j:BarSection> + </j:BarSection> <j:BarSection width="50%" itemsHorizontalAlign="itemsRight"> <j:Label text="Slide to fill"/> <j:HSlider localId="slider" value="0" minimum="0" maximum="500" valueChange="changeFill(event)"/> - </j:BarSection> + </j:BarSection> </j:CardActions> - </j:Card> + </j:Card> </j:View> </j:initialView>