OpenLaszlo drag and rotate issue - openlaszlo

I have written one sample code for rotating and dragging a view. Both are working properly in openlaszlo swf runtime but it's not working as is in DHTML runtime.
In both OL 4.9 and in openlaszlo 5.0 i see that there is a small displacement. I have attached a git hub link
https://github.com/karthick6891/cvs/tree/master/rotateanddrag
Can any one tell me what is wrong here?

Related

rid3, shadow-cljs & drag; different behavior in dev and prod

I'm creating an application which can be used to make an overview of your IT-Landscape. Currently it can show a table with the interfaces in your environment and their connected applications. It is also capable of creating an SVG image from this data. The data it self can be added via API calls.
I started with a project via:
leiningen new luminus versiontracker +h2 +shadow-cljs +kee-frame +swagger +(some other)
To be able to generate the SVG file with drag-and-drop support I added rid3 to the project .clj file.
When I run the application in development mode:
lein repl
and
lein shadow-cljs watch app
I can drag any item in the SVG file that is generated. I can click on a circle and drag it to any place I want.
However when I create the 'production' version with:
lein uberjar
and then run this application using:
java -Dconf=config.edn -jar versiontracker.jar
Dragging an object is not working properly. The whole SVG is selected instead of a single object within the SVG image; which result in strange drag-and-drop behavior.
Looking at the event through the console window I can see different behavior.
In the development environment if I grab a circle (which has the drag function attached) the srcElement in the sourceEvent is the text that is displayed on top of this circle. Although not the circle is selected dragging works as expected. The selected item follows the mouse while dragging.
In the 'production' environment if I grab a circle the srcElement in the sourceEvent is the complete svg; which result in strange drag-and-drop behavior. The selected item does not follow the mouse but the items do start moving around in an unpredictable way.
Go to Version Tracker download the release with tag V0.3.0 for the production version (there is also an H2 database with some sample data) and compare it to the development version by checking out the project.
Any help is appreciated
Your error description is a bit lacking and the project is far too complex to quickly reproduce.
Do you get any externs inference warnings when building? Do you get any errors/warnings in the Browser console with a production build?
The most likely cause here is externs. Meaning that property names such as in this (set! (.-fx d) (.-x event)) may end up getting renamed or stripped. As such it would break any behavior that relies in picking the correct names. See the documentation for further info on the subject. It might be enough to add a couple ^js hints in the proper places.
You are also using a rather old shadow-cljs version (current as of today is 2.16.10). So you need to opt-in to get externs inference warnings via :compiler-options {:infer-externs :auto} in your build config. The newer versions have this enabled by default.

problem with setInteractive function in phaser 3

I have recently started using version 3.18 for a game which was earlier developed in version 3.9. Also, I am using Phaser.SCALE.FIT in config.
But on clicking or touching(in case of mobile) on some button images on the canvas nothing happens. I am using gameObject.setInteractive() and then gameObject.on(‘pointerdown’, function(){}) but the pointer down is not detected.
But if the size of the browser window changes somehow in between the game then the click is detected and everything else works fine.
How can I fix this issue any suggestion will be great help.
I don’t know the exact problem but when I used scene.scale.setGameSize(width, height) (https://rexrainbow.github.io/phaser3-rex-notes/docs/site/scalemanager/#events) in the create() the game starts working properly.

adobe edge animation not rendering in iOS 6

I've created a very simple animation in Adobe Edge Animate that animates a box moving from the bottom right to the top left.
I've imported this file (html + all other files) into my Xcode (v4.5.2) project but get a blank white screen in the simulator. I know my project is fine because if I copy a static html page into the project it renders correctly.
Any ideas?
since the difference between your project and the test page is that your project links to javascript files while the test page did not, maybe you should run a test with a page that calls a simple javascript library.
There are a few threads on adobe forum about some problems with projects opened on ios 6 devices. Maby this also concerns your project.
http://forums.adobe.com/message/4767681
Try to call this method and add some js code to your webview's document:
[webView stringByEvaluatingJavaScriptFromString:#"window.requestAnimationFrame = window.setTimeout;"];

Images do not show up when I run my app on iOS device

I have images titled like so in my app:
image~iPhone.png
image#2x~iPhone.png
In interface builder I am loading image.png into my UIImageView. I also programatically load some images into a different view using imageWithContentsOfFile. The images all load fine when I run in the simulator but I get no images when I run on the device. If I use the full name of the image in interface builder it works but I want iOS to distinguish between high res and lower res. I have tried a lot of different things but can't figure this out. I see this error in the debugger as well:
Could not load the "image.png" image referenced from a nib in the bundle with identifier "com.mycompany.myproject"
Xcode 4
Deployment Target 4.1
Base SDK 4.3
Thanks for any help.
Ok...so after much experimenting I got it working.
I had two images named:
image#2x~iPhone.png
image~iPhone.png
and I was trying to load them using IB or imageWithContentsOfFile using
image.png
This worked fine in the simulator but not on my device. I just got a blank white screen where the image should be.
I finally renamed the high resolution image to:
image~iPhone#2x.png
Moving the '#2x' modifier after the device modifier(~iPhone) when referencing my images allowed it to work the way I understood that it should from reading Apple's docs. I was under the impression that you didn't need to include the device modifier when referencing images but I had to.
To sum up, I am now using
- image~iPhone.png
to reference my images in IB and programatically for some images. I now get iOS recognizing that I am on a retina screen and loading the #2x images accordingly. So the #2x modifier had to go at the end and the ~iPhone modifier had to be included in the name of the '.png'.
That is what worked for me. Hope it helps someone else. Note that I am only building my app for iOS4.1 and above so there might be some issues with this if you are supporting previous version.
iOS does not automatically pick the right image for the device like that. You are going to have to write code to check which device it is, and set the image by full name.
e.g. if ([[UIScreen mainScreen] scale] == 2) // set hi res image
Or, you can just use the same image in both, and set the content mode to scale to fill. It will look the same.
EDIT: Try writing either ~iphone (lowercase), or just don't write ~iPhone at all on the file name. If your app is not universal, then writing the ~iphone suffix is completely pointless.
iOS file system is case sensitive and device modifiers should be lowercase, it should be
image~iphone.png
image#2x~iphone.png
The #2x comes before the device modifier.
See the resource programming guide

How to set Legend with Open Flash Chart 2 graphic using Open source Java API - JOFC?

I have a Seam 2.2 app running under JBoss5.1. In this application I have successfully developed some Graphics using Java Open Flash Chart, which is a Java API for Open Flash Chart.
Now I would like to add a X and Y legend like this one.
Well I have a graphic which is rendering properly and than I try to set X Label using:
...
chart.setXLegend(new Text("Legenda X"));
But than instead of showing the legend it corrupts something which causes the graphic to renders completely blank.
This is the generated JSon when the graphics renders correctly.
{"y_axis":{"min":388,"max":866,"steps":20},"title":{"text":"Gráfico de gasto mensal com Combustível"},"bg_colour":"#FFFFFF","is_decimal_separator_comma":0,"elements":[{"values":[{"tip":"R$:610.0\n05/2010","top":610},{"tip":"R$:488.0\n06/2010","top":488},{"tip":"R$:634.57\n07/2010","top":634.57},{"tip":"R$:766.0\n08/2010","top":766},{"tip":"R$:396.0\n09/2010","top":396},{"tip":"R$:610.0\n10/2010","top":610}],"type":"bar"}],"num_decimals":2,"is_fixed_num_decimals_forced":0,"x_axis":{"labels":{"labels":["05/2010","06/2010","07/2010","08/2010","09/2010","10/2010"]}},"is_thousand_separator_disabled":0}
I took a deeply look at it and turns out that whenever I try to add the x legend with the code fragment showed above the JSon is actually NOT generated by JOFC.
I could not find much useful documentation on JOFC on the web and the API itself is not very well documented, so I am completely lost on trying to add this simple x label, which should be the easiest part :( . Any Ideas on that.
An update:
Now I just have downloaded JOFC source code and will take a look at this.
It looks like there's an open issue on the JOFC page: http://code.google.com/p/jofc2/issues/detail?id=29
It suggests a workaround of calling the function like:
chart.setXLegend(new Text("Legenda X", Text.TEXT_ALIGN_CENTER))
I would try with Open Flash Grapix, it is easier to use, and just sets parameters on FlashVars.
Open Flash Grapix

Resources