You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/01/28 14:10:49 UTC

[jira] Commented: (HARMONY-2050) [classlib][awt] Incorrect drawing of dashed line

    [ https://issues.apache.org/jira/browse/HARMONY-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468106 ] 

Alexey Petrenko commented on HARMONY-2050:
------------------------------------------

Alexander,

I do not like the patch...

There are at least 3 potential issues:
1. It creates a new float array but does not free it.
2. It replaces dash variable value with new one. So the following ReleasePrimitiveArrayCritical call with the dash as parameter becomes incorrect.
3. Probably it's better to use memcpy function instead of two cycles

And the last one. The patch does not help on my W2K Server machine... What platforms did you test the patch on?

> [classlib][awt] Incorrect drawing of dashed line
> ------------------------------------------------
>
>                 Key: HARMONY-2050
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2050
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Alexey Petrenko
>         Attachments: dashExtending2050.patch, HARMONY-2050-actual.PNG, HARMONY-2050-expected.PNG
>
>
> Sequence should be 
> 4 - fill
> 4 - empty
> 8 - fill
> 4 - empty
> 4 - fill
> 8 - empty
> and so on, but we have got
> 4 - fill
> 4 - empty
> 12 - fill
> 4 - empty
> 12 - fill
> 4 - empty
> and so on.
> ============== Test =============
> import java.awt.BasicStroke;
> import java.awt.Color;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.geom.Line2D;
> import javax.swing.JFrame;
> public class Test {
>         public static void main(String[] args) {
>                 JFrame f = new JFrame("Test Stroke") {
>                         public void paint(Graphics g) {
>                             Graphics2D g2 = (Graphics2D)g;
>                             g.setColor(Color.blue);
>                             g2.setStroke(new BasicStroke(1, 0, 0, 10, new float[]{4, 4, 8}, 0));
>                             g2.draw(new Line2D.Float(20, 50, 80, 50));
>                             g2.setStroke(new BasicStroke(2, 0, 0, 10, new float[]{4, 4, 8}, 0));
>                             g2.draw(new Line2D.Float(20, 60, 80, 60));
>                         }
>                 };
>                 f.addWindowListener(
>                         new WindowAdapter() {
>                                 public void windowClosing(WindowEvent e) {
>                                         System.exit(0);
>                                 }
>                             }
>                     );              
>                 f.setSize(100, 100);
>                 f.show();
>         }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.