Hello, I'm trying to clean out some old changes. I came across this. I made the changes previously but did not submit. I had probably gotten distracted.
I have updated the example to draw (line, circle, rectangle, ellipse), and fill (circle, rectangle and ellipse). However, something about the ellipse fill code is not right. It tends to make my browser use all the CPU and not respond. While not the fastest machine, it's far from the slowest, running an AMD Athlon XP 2700+. JavaScript code should never kill a browser's CPU. ;-) Certainly not on a CPU at this speed. Furthermore, the "delete last" and "delete all" is unimplemented. I could not determine how best to approach this. I attempted to destroy all children. At the document level, it removes the Graphics layer as well as it's children. On the layer level, the function was not defined, which I could not understand. For specific examples of my pitiful attempts, see the example source code. In addition, there were "drawOval" and "fillEllipse" method names. I found this to be inconsistent and confusing so I made the first "drawEllipse", then added aliases for "drawOval" and "fillOval", for backwards compatibility and ease of use. I would like to submit the example code and the library code, get any other fixes or suggestions, and then if it's agreed that the name changes are clearer, I'd like to update the documentation and complete this little bugfix in a comprehensive manner. Actually, I just looked, and there is no documentation for Graphics, or the contents of graphics.js. If someone could suggest which naming structure to use, and which fileto use as a template, I will create the documentation for this object, at least for the portions I understand. ;-) Reference files: dynapi3x/docs/docs/quickref.gui.graphics.html ? dynapi3x/examples/dynapi.gui.graphics.html dynapi3x/src/gui/graphics.js Leif ----- Original Message ----- From: "Andrew Gillett" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 31, 2004 7:15 PM Subject: Re: [Dynapi-Dev] Some fixes for src/gui/graphics.js > Hi Leif, > > My suggested changes do make a difference. > > Try making the following changes to examples/dynapi.gui.graphics.html. > Change line 25 from: > graphics.setFillColor(lyr.bgcolor); > to: > graphics.setFillColor('green'); > > and change line 36 from: > graphics.drawCircle(... > to > graphics.fillCircle(... > > This should cause the "draw circle" button to draw filled green > circles. WIthout my changes it doesn't work because the > Graphics.setFillColor() method is not setting the same variable that the > Graphics.fillCircle() method uses. > > > Andrew. > > > Leif W wrote: > > >Hi! I've made changes to my local copy and played with the example page. > >Can't see any difference, but the example is very simple (draw line, circle, > >and rectangle - yes I added a rectangle to the example -- button was there > >but onclick was empty -- which I'll upload to CVS later). Do you have any > >more complex example pages up with the two different src/gui/graphics.js > >files, which reveal the bugs caused by the forgotten relics? > > > >Leif > > > >----- Original Message ----- > >From: "Andrew Gillett" <[EMAIL PROTECTED]><[EMAIL PROTECTED]> > >To: "dynapi-dev" > >Sent: Thursday, March 25, 2004 12:18 AM > >Subject: [Dynapi-Dev] Some fixes for src/gui/graphics.js > > > > > > > > > >>Hi, > >> > >>I was looking at some of the graphics functions (dynapi 3) > >>and there are some simple errors. It looks like some variables > >>were renamed at some point, but the old variable names were > >>not all cleaned up. Perhaps someone can commit the changes > >>below to CVS? > >> > >>The correct variable names are: > >>_s StrokeColor (was color) > >>_w StrokeWeight (was thickness) > >>_f FillColor (was color) > >> > >> > >>Andrew. > >> > >> > >>49c49 > >>< fillCircle(x+r,y+r,r,this.color,this._dlyr); > >>--- > >> > fillCircle(x+r,y+r,r,this._f,this._dlyr); > >>52c52 > >>< > >>drawEllipse(x+w/2,y+h/2,w,h,this.color,false,this.thickness,this._dlyr ); > >>--- > >> > drawEllipse(x+w/2,y+h/2,w,h,this._s,false,this._w,this._dlyr); > >>55c55 > >>< > >>drawEllipse(x+w/2,y+h/2,w,h,this.color,true,this.thickness,this._dlyr) ; > >>--- > >> > drawEllipse(x+w/2,y+h/2,w,h,this._f,true,this._w,this._dlyr); > >>58c58 > >>< drawRect(x,y,w,h,this.color,this.thickness,this._dlyr); > >>--- > >> > drawRect(x,y,w,h,this._s,this._w,this._dlyr); > >>61c61 > >>< fillRect(x,y,w,h,this.color,this._dlyr); > >>--- > >> > fillRect(x,y,w,h,this._f,this._dlyr); > >> > >> > >> > >> > >> > >>------------------------------------------------------- > >>This SF.Net email is sponsored by: IBM Linux Tutorials > >>Free Linux tutorial presented by Daniel Robbins, President and CEO of > >>GenToo technologies. Learn everything from fundamentals to system > >>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > >>_______________________________________________ > >>Dynapi-Dev mailing list > >>[EMAIL PROTECTED]://www.mail-archive.com/dynapi-dev @lists.sourceforge.net/ > >> > >> > >> > >> > >> > > > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: IBM Linux Tutorials > >Free Linux tutorial presented by Daniel Robbins, President and CEO of > >GenToo technologies. Learn everything from fundamentals to system > >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > >_______________________________________________ > >Dynapi-Dev mailing list > >[EMAIL PROTECTED]://www.mail-archive.com/dynapi-dev@ lists.sourceforge.net/ > > > > > > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Dynapi-Dev mailing list > [EMAIL PROTECTED] > http://www.mail-archive.com/[EMAIL PROTECTED]/ > > ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/