Changeset 47

Show
Ignore:
Timestamp:
04/10/07 10:14:58 (1 year ago)
Author:
altglass
Message:

Slider cursor is now drawn

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vlcskineditor/Items/Slider.java

    r45 r47  
    8787    if(code.length>1) { 
    8888      for(int i=0;i<code.length;i++) { 
    89         if(code[i].startsWith("<SliderBackground")) { 
     89        if (code[i].startsWith("<!--")) { 
     90          while(code[i].indexOf("-->")==-1) { 
     91            i++; 
     92          } 
     93        } 
     94        else if(code[i].startsWith("<SliderBackground")) { 
    9095          sbg = new SliderBackground(code[i],s); 
    9196          break; 
     
    462467  public void draw(Graphics2D g, int x_, int y_) { 
    463468    if(s.gvars.parseBoolean(visible)==false) return; 
     469    String[] pnts = points.split("\\),\\("); 
     470    int[] xpos = new int[pnts.length]; 
     471    int[] ypos = new int[pnts.length]; 
     472    for(int i=0;i<pnts.length;i++) { 
     473      String pnt = pnts[i];       
     474      String[] coords = pnt.split(",");         
     475      xpos[i] = Integer.parseInt(coords[0].replaceAll("\\(",""))+x+x_; 
     476      ypos[i] = Integer.parseInt(coords[1].replaceAll("\\)",""))+y+y_; 
     477    }           
    464478    if(sbg!=null) { 
    465479      sbg.draw(g,x+x_,y+y_); 
    466480      sbg.setOffset(x+offsetx,y+offsety); 
    467481    }     
     482    java.awt.image.BufferedImage si = s.getBitmapImage(up); 
     483    g.drawImage(si,xpos[0]-si.getWidth()/2,ypos[0]-si.getHeight()/2,null); 
    468484    if(selected) {         
    469       String[] pnts = points.split("\\),\\("); 
    470       int[] xpos = new int[pnts.length]; 
    471       int[] ypos = new int[pnts.length]; 
    472       for(int i=0;i<pnts.length;i++) { 
    473         String pnt = pnts[i];       
    474         String[] coords = pnt.split(",");         
    475         xpos[i] = Integer.parseInt(coords[0].replaceAll("\\(",""))+x+x_; 
    476         ypos[i] = Integer.parseInt(coords[1].replaceAll("\\)",""))+y+y_; 
    477       } 
    478485      g.setColor(Color.RED); 
    479486      g.drawPolyline(xpos,ypos,pnts.length);