Camelia, the Perl 6 bug

IRC log for #cdk, 2009-11-02

| Channels | #cdk index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
05:48 egonw joined #cdk
06:46 sneumann__ joined #cdk
06:48 slyrus_ joined #cdk
07:16 jbrefort joined #cdk
07:31 jonalv joined #cdk
07:56 sneumann__ joined #cdk
08:04 LillePedro joined #cdk
08:05 Gpox joined #cdk
08:18 mgerlich joined #cdk
08:58 s_wolf joined #cdk
08:59 LillePedro egonw: where do I report bug/bug fixes? cdk-jchempaint@... Is it the sourceforge mailing list that you referred to last friday?
08:59 LillePedro I wonder if I can paste git diff result in here...
09:00 LillePedro diff --git a/src/main/org/openscience/cdk/ren​derer/visitor/AWTDrawVisitor.java b/src/main/org/openscience/cdk/ren​derer/visitor/AWTDrawVisitor.java
09:00 LillePedro index d7e0d4a..9179706 100644
09:00 LillePedro --- a/src/main/org/openscience/cdk/ren​derer/visitor/AWTDrawVisitor.java
09:00 LillePedro +++ b/src/main/org/openscience/cdk/ren​derer/visitor/AWTDrawVisitor.java
09:00 LillePedro @@ -153,9 +153,9 @@ public class AWTDrawVisitor extends AbstractAWTDrawVisitor {
09:00 LillePedro public void visit(OvalElement oval) {
09:00 LillePedro this.g.setColor(oval.color);
09:00 LillePedro int[] min =
09:00 LillePedro -            this.transformPoint(oval.x - oval.radius, oval.y - oval.radius);
09:00 LillePedro +            this.transformPoint(oval.x - oval.radius, oval.y + oval.radius);
09:00 LillePedro int[] max =
09:00 LillePedro -            this.transformPoint(oval.x + oval.radius, oval.y + oval.radius);
09:00 LillePedro +            this.transformPoint(oval.x + oval.radius, oval.y - oval.radius);
09:00 LillePedro int w = max[0] - min[0];
09:00 LillePedro int h = max[1] - min[1];
09:00 LillePedro if (oval.fill) {
09:00 egonw LillePedro: depends a bit...
09:00 egonw if the bug is about the JChemPaint application you go to X
09:01 * egonw is looking up X
09:01 egonw otherwise at cdk.sf.net
09:01 egonw but to the mailing list would be a good start too...
09:01 LillePedro what's X?
09:01 egonw LillePedro: preferably use cdk.pastebin.com for pasting lots of content :)
09:01 egonw yeah, I'm looking that up :)
09:02 egonw X :=
09:02 egonw ...
09:02 egonw https://sourceforge.net/apps/trac/jchempaint/
09:02 egonw Look for the 'New Ticket'
09:02 egonw or 'View Tickets'
09:03 egonw that one is for stuff with menu's etc...
09:03 egonw translations of the applet
09:03 egonw that kind of stuff
09:03 egonw the above patch should go to the other one
09:03 egonw being the underlying rendering library...
09:04 LillePedro Thanks. It seems that sourceforge won't return an initial account email message. I'll get to it as soon as possible.
09:04 egonw from the top of my hat...
09:04 egonw I think the patch is not the right fix for the problem
09:04 egonw it looks to me that it is another instance of the coordinate system issue
09:04 egonw which should be solved at a different location...
09:05 egonw the renderer code should not correct for the Y axis flipping between world coordinates and screen coordinates
09:05 egonw and your patch does exactly seem to do that...
09:05 egonw ... or ... ?
09:06 LillePedro the patch is the result from random guesswork. I admit that.
09:06 egonw :)
09:06 egonw no worries
09:06 egonw it's a common pattern
09:06 egonw but please do file it...
09:06 egonw it's most certainly an excellent clue of what goes wrong...
09:08 LillePedro Yeah, but where did the code go wrong in my case...?
09:09 egonw well, the max is maxier of you do the original + instead of your -
09:09 LillePedro First using StructureDiagramGenerator to generate coordinates...
09:09 * egonw found a word-of-the-day: maxier :)
09:10 LillePedro Then doing this code in my generator:
09:10 LillePedro Point2d p = atom.getPoint2d();
09:10 LillePedro double r = model.getAtomRadius() / model.getScale();
09:10 LillePedro OvalElement textGroup = new OvalElement(p.x, p.y, r, new Color(255,140,0,150));
09:12 egonw that looks good
09:13 LillePedro p.x == -1.299038105676657
09:14 LillePedro p.y == 2.2500000000000018
09:16 egonw fine too, I'd say
09:16 egonw it's the location...
09:18 LillePedro Yeah, but consider this picture: http://lh4.ggpht.com/_-D6xM_MrnrE/Su6js​OpthxI/AAAAAAAAAFg/SQNcpQ8pdTQ/s1024/Sc​reenshot-Reactant%2520-%2520Product.jpg
09:18 zarah LillePedro's link is also http://tinyurl.com/yla9qu3
09:19 egonw what's wrong with that?
09:19 egonw the ovals look ok, not?
09:19 LillePedro The atom having the digit "1" printed, is the one having the above coordinates
09:20 LillePedro The "1" is printed correctly without special handling, but the ovals need my patch to render at the correct location.
09:22 LillePedro Without the patch, the height of the oval will be negative, and the entire oval will print "off the chart"
09:24 egonw so, what's the value for r than?
09:24 egonw is model.getAtomRadius() or model.getScale() negative ?
09:26 LillePedro I'll check it out but firstly have a look at: http://lh3.ggpht.com/_-D6xM_MrnrE/Su6lpx​Xl4DI/AAAAAAAAAFk/76k5VOTTR3I/s1024/Scre​enshot-Reactant%2520-%2520Product-1.jpg
09:26 zarah LillePedro's link is also http://tinyurl.com/yappa9k
09:27 LillePedro I made the negative height positive to make it render at all.
09:28 LillePedro atomRadius == 8.0
09:29 LillePedro scale == 26.666666666666668
09:29 egonw ok, that's good...
09:30 egonw Gpox: ping
09:31 egonw Gpox: can you give LillePedro a URL for the SWT implementation of visit(OvalElement oval)
09:31 egonw ?
09:31 egonw LillePedro: please compare with the SWT implementation of Arvid
09:32 Gpox http://github.com/egonw/bioclipse.chemin​formatics/blob/2.2.x/plugins/net.bioclip​se.cdk.jchempaint.view/src/net/bioclipse​/cdk/jchempaint/view/SWTRenderer.java
09:32 zarah Gpox's link is also http://tinyurl.com/yawm8qy
09:36 egonw Gpox: thanx!
09:41 Gpox I would say the problem is mixing transformations of a point and a distance
09:44 LillePedro The SWTRenderer implementation works as expected, while AWTDrawVisitor does not
09:45 Gpox to scale the oval with the transform you would have to have 0,0 at the center, the SWTRenderer works around that issue by scaling the position and the size in different steps
09:47 Gpox actually it might be more than that, notice you i scale the radius with the x-scalefactor the y would result in a negative radius
09:50 LillePedro That's just a desperate measure I took. Better yet to simply copy SWTRenderer's code to AWTDrawVisitor... Who does that?
09:51 egonw we would need to check if AWT has a matching API for constructing an oval...
09:56 LillePedro the graphics object also has fillOval. I just copied the code for the visit method. I also copied transformX, transformY and transform methods. The thing left is color handling, where i kept the original colour code.
09:57 LillePedro ... of the AWTDrawVisitor class.
10:00 CIA-71 cdk: egonw * r15035 /cdk-taverna-paper/branches/submit1/ (. cdk-taverna/ cdk-taverna/): Submitted version
10:04 CIA-71 cdk: egonw * r15036 /cdk-taverna-paper/ (branches/submit1/ tags/submit1/): Ummm... clearly that's a tag, not a branch :(
10:09 egonw LillePedro: let me know it that works...
10:10 egonw if so, please use 'git format-patch' and send me a patch
10:10 egonw then I can apply it to the main branch
10:30 LillePedro I'm totally new to Git. git format-patch command renders nothing. advise?
10:58 egonw sorry...
10:58 egonw did not notice your question earlier...
10:58 egonw it takes a commit hash as parameter
10:58 egonw git format-patch HASH
10:59 egonw check with 'git log'
10:59 egonw for the hashes
10:59 egonw you need to give the latest hash *before* the interesting patches
11:02 LillePedro That's better
11:12 LillePedro ...or worse. I am creating a mess here. How do I un-commit such that 'git log' sort of forgets a commit?
11:16 egonw try:
11:16 egonw git rebase -i HEAD~5
11:16 egonw which gets you a list of patches
11:16 egonw each lines starts with 'pick'
11:17 egonw indicating that the patch should be kept...
11:17 egonw removing the full line makes the patch disappear
11:21 egonw then save file
11:21 egonw and exit editor
11:33 LillePedro Sorry, I made a git-reset. Might have rendered git-rebase useless hmm. better to wipe the directory and start from the beginning.
12:03 egonw joined #cdk
12:04 egonw and I'm back
12:51 CIA-71 cdk: mark_rynbeek * r15037 /jchempaint/trunk/src/main/org/openscien​ce/jchempaint/JChemPaintMenuHelper.java: Reformatted
13:10 CIA-71 cdk: mark_rynbeek * r15038 /jchempaint/trunk/ (5 files in 3 dirs): Applet jar business
13:12 CIA-71 cdk: egonw * r15039 /cdk-taverna-paper/trunk/cd​k-taverna/worker-overview/ (. clean.groovy cleanst.html): Working on a cleaner table of workers
13:18 LillePedro egonw: where can I email the patches?
13:22 egonw egon.willighagen at farmbio.uu.se
13:34 CIA-71 cdk: mark_rynbeek * r15040 /jchempaint/trunk/po/ru.po: New russion lang file
13:34 sneumann__ joined #cdk
16:45 sneumann__ joined #cdk
16:59 egonw joined #cdk
20:19 jbrefort joined #cdk
21:35 slyrus_ joined #cdk
21:47 CIA-71 cdk: mark_rynbeek * r15041 /jchempaint/trunk/src/main/org/opensc​ience/jchempaint/resources/small-bin/ (7 files): nice icons
22:28 CIA-71 cdk: Peter Odéus cdk-1.2.x * re33fba2 / build.xml :
22:28 CIA-71 cdk: Added generation of java source jars
22:28 CIA-71 cdk: Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net> - http://bit.ly/11hnKi

| Channels | #cdk index | Today | | Search | Google Search | Plain-Text | summary