Bugfix when monitor adjustments or switching occurs, nulling out the

mouse cursor.
master
sigonasr2 5 years ago
parent 71e9a6872c
commit fad14b1843
  1. BIN
      sigIRCv2.jar
  2. 12
      src/sig/MyPanel.java
  3. 2
      src/sig/modules/TwitchModule.java

Binary file not shown.

@ -75,10 +75,14 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
super.paintComponent(g);
// Draw Text
//int counter=18;
if (sigIRC.panel!=null) {
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY());
//System.out.println("("+lastMouseX+","+lastMouseY+")");
try {
if (sigIRC.panel!=null && MouseInfo.getPointerInfo()!=null) {
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY());
//System.out.println("("+lastMouseX+","+lastMouseY+")");
}
} catch (NullPointerException e) {
//Do Nothing I guess.
}
/*if (sigIRC.window!=null && sigIRC.window.getMousePosition(true)!=null && sigIRC.overlayMode) {
lastMouseX = (int)sigIRC.window.getMousePosition(true).getX();

@ -63,6 +63,7 @@ public class TwitchModule extends Module{
public static BufferedImage DOWNARROWIMAGE;
public static BufferedImage UPTIMEIMAGE;
public static long myTwitchChannelID = 0;
public int previous_xoffset = 0;
public TwitchModule(Rectangle2D bounds, String moduleName) {
this(bounds,moduleName,true);
@ -442,6 +443,7 @@ public class TwitchModule extends Module{
g.fillPolygon(new int[]{(int)position.getX(),(int)(position.getX()+position.getWidth()),(int)(position.getX()+position.getWidth()),(int)position.getX()},
new int[]{yoffset-4,yoffset-4,yoffset+16,yoffset+16},
4);
previous_xoffset = xoffset;
if (currentlyPlaying!=null && currentlyPlaying.length()>0) {
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, xoffset, yoffset+TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.panel.userFont).getHeight()/2+3, 2, g.getColor(), new Color(195,195,195), currentlyPlaying);xoffset+=TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.panel.userFont).getWidth()+16;
}

Loading…
Cancel
Save