[ 
https://issues.apache.org/jira/browse/PIVOT-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14611446#comment-14611446
 ] 

João Martins commented on PIVOT-964:
------------------------------------

Hi all!

Some bad news. It looks like there might've been some unintended side-effects 
to List com.kitfox.svg.SVGDiagram.pick(Point2D point, List retVec) from the 
latest changes.

Using the Maven svgSalamander jar, I can get an accurate list of SvgElements 
under the mouse-click. Current behaviour with svgSlamander-tiny.jar file from 
2.0.x, is strange. It appears that clicks are not mapped to the correct 
position in the SVG Diagram. It's working, since clicking in empty spots of the 
screen sometimes comes up with the same SVG Elements that I can get with Maven 
svgSalamander.jar... it's just not working as intended!

So, the "real" rects get mapped into "ghost" rects.

So far I've been able to determine it's not just a translation of the original 
SVG, so it's not just to do with offsets. The "ghost" rect that I can click on 
appears bigger than the "real" rect, and sometimes I can't even find any 
"ghost" rect.



I don't have a minimalist example right now. But I switched my project to 
Gradle, so it should be relatively easy to get up and running. It will download 
gradle into your computer, along with dependencies (Apache Pivot + 
svgSalamander) from the Maven repository. Instructions are:
- Checkout https://github.com/jgmartins/Full-Thrust
- run "gradlew eclipse", (gradlew.bat for Windows) which should create Eclipse 
projects for FTL-Core, FTL-Server, FTL-Client. If it's not finding 
dependencies, run "gradlew build" first, and then "gradlew eclipse again"
- Open Eclipse with the workspace inside the Full-Thrust folder that you 
checked out, then create each of the projects. They should be configured.

To run,
- Run org.fullthrust.server.Server first, and then 
org.fullthrust.client.Client. The run configurations need to be set up so that 
the working directory (found under the Arguments tab in Run Configurations) is 
the Full-Thrust folder. Using "${workspace_loc}" works.
- Once the client opens, make sure to click one of the buttons for choosing a 
faction.
- Because of the bug in svgSalamander.jar, *the screen will be empty*. But some 
viewBoxes work, as per this bug report! A viewbox that shows the ImageView for 
me is [DEBUG] Setting viewBox: -275 -204 551 408 (this is debug output in the 
console). You can pan the image using right-click (which centers the screen on 
the mouse location) until the image shows up (don't mind the graphics, they are 
buggy). Now, left-clicking on the rect or on the ships will cause a console 
message to be printed out with SVG Element IDs found under the mouse. The two 
nulls are the visible white/blue rect, and MyShipID identifies the ships. This 
also works when the image is not displaying.

To test 2.0.x svgSalamander-tiny, you can just change the build path for 
FTL-Client to point at it. There is a copy under FTL-Client/. The image will 
display correctly (minus some strange scaling under the faction selection 
screen that might be a bug on my part - not sure!). Clicking now does not 
"pick" the right SVG Elements under the mouse.


This is complicated, but should get you an interactive example. I'll try to 
come up with a minimalist example at some point though, unless the cause of 
this is somehow obvious from the changes made :)

> Changes in SVG viewBox attribute causes SVG not to render.
> ----------------------------------------------------------
>
>                 Key: PIVOT-964
>                 URL: https://issues.apache.org/jira/browse/PIVOT-964
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0.4
>         Environment: Windows 7, Java 1.7, Eclipse, Pivot 2.0.4, svgSalamander
>            Reporter: João Martins
>            Assignee: Sandro Martini
>              Labels: svgSalamander
>             Fix For: 2.1, 2.0.5
>
>         Attachments: TestClient2.java, TestClient3.java
>
>
> We try to display a simple SVG file with a rect of width 2000 and height 
> 1000. This is done using an ImageView.
> We have two values of viewBox, both of which capture at least part of the 
> rectangle. For one of them, the rectangle is rendered. For the other, it 
> isn't (but should).
> The exact same scenario, using svgSalamander & Java Swing, works. With Pivot 
> instead of Swing, it does not.
> Here is a Swing minimal example: http://pastebin.com/i0xJbUTg
> Here is a Pivot minimal example: http://pastebin.com/tpgnVe0c



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to