b-deng / red5-screenshare

Automatically exported from code.google.com/p/red5-screenshare
0 stars 0 forks source link

Screen area width and height goes less then zero #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to make Screen Area to be captured width or height less then zero, by 
mouse resizing.

What is the expected output? What do you see instead?
It shouldn't be less then zero, but it is.

Please provide any additional information below.

To fix it, you need to make some changes:

VirtualScreenWidthMouseListener.java: 
mouseDragged method should be (added newWidth check):

    public void mouseDragged(MouseEvent e) {
        double newX = e.getX();

        int delta = Long.valueOf(Math.round(this.x-newX)).intValue();
        int newWidth = VirtualScreenBean.vScreenSpinnerWidth-delta;

        //System.out.println(newX+"  "+newWidth);
        if ( ((VirtualScreenBean.vScreenSpinnerX+newWidth)<=VirtualScreenBean.screenWidthMax) && (newWidth >= 0)) {

VirtualScreenHeightMouseListener.java:
mouseDragged method should be (added newHeight check):

    public void mouseDragged(MouseEvent e) {
        double newY = e.getY();

        int delta = Long.valueOf(Math.round(this.y-newY)).intValue();
        int newHeight = VirtualScreenBean.vScreenSpinnerHeight-delta;

        //System.out.println(delta+" "+newHeight);
        if (((VirtualScreenBean.vScreenSpinnerY+newHeight)<=VirtualScreenBean.screenHeightMax) && newHeight >= 0) {

Than, you should recomplie, make jar, sign it and it's done!

Thanks for your project!

Original issue reported on code.google.com by vtek2...@gmail.com on 4 Oct 2011 at 11:26

GoogleCodeExporter commented 9 years ago
Thank you for your contribution :-)

Original comment by olajide....@gmail.com on 7 Oct 2011 at 11:25