sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #21704
[Bug 1220575] Re: [1.0.1] Linux: Matching preview not working
Hey RainMan,
I believe I fixed one part of the problem on my machine. The score
calculation was incorrect. I don't know how this can work in windows...
Here is the new code which calculates correctly a value from 0 to 1 in
org.sikuli.ide.PatternSimilaritySlider.paintComponent:
@Override
protected void paintComponent(Graphics g) {
int w = getWidth();
final int margin = 13;
final int y1 = 20, y2 = 30;
for (int i = 0; i < w - (margin *2); i++) {
float score = (float) i / (w - margin);
g.setColor(getScoreColor(score));
g.drawLine(i + margin, y1, i + margin, y2);
}
if (getValue() != curVal) {
curVal = getValue();
showValue(lblVal, curVal);
}
super.paintComponent(g);
}
Only problem is that the slider is not taking over the space it should
on the screen, so at first everything on the slider is squeezed. After I
maximize the window, the slide shows correctly with the colors.
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1220575
Title:
[1.0.1] Linux: Matching preview not working
Status in Sikuli:
In Progress
Bug description:
This is a Linux only issue (java version "1.7.0_25")
Open IDE editor, click a image saved before. Click "Matching
Preview", it will not work. You can got error message from console:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Color parameter outside of expected range: Alpha
at java.awt.Color.testColorValueRange(Unknown Source)
at java.awt.Color.<init>(Unknown Source)
at org.sikuli.ide.PatternSimilaritySlider.getScoreColor(PatternSimilaritySlider.java:59)
at org.sikuli.ide.PatternSimilaritySlider.paintComponent(PatternSimilaritySlider.java:37)
at javax.swing.JComponent.paint(Unknown Source)
... more
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1220575/+subscriptions
References