kimoa / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
3 stars 0 forks source link

Deleting all text from text input breaks that text object as well as svgcanvas display (Firefox) #352

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new text object
2. (Optional) Enter some text in the input field
3. Delete all text from the input field

What is the expected output? What do you see instead?

This should not affect the svg-editor at all - should be able to continue
typing in the text input field.  Instead, if you attempt to type in the
text input field after deleting, nothing happens to the actual text object
on the svgcanvas (it remains empty).  From then on, the text tool is
broken.  Creating a new text object generates the new object, but the
contents always remain empty. 

Also, this seems to break the previews when using any other tool from then
on.  So, for example, after deleting all the text from a new text object,
if you attempt to draw any other object, the preview image (when holding
the mouse down and drawing a new shape for example) does not show up. Also,
the preview selection box (when holding the mouse down and dragging on the
canvas) is broken as well - so you have no indication as to what portion of
the canvas you are selecting objects from.

Only reloading the tool fixes this bug.

In what browser did you experience this problem? (ALL, Firefox, Opera 10
Alpha, etc)

Firefox 3.5+

Please provide any additional information below.

This bug seems only to happen in Firefox.  Safari and Chrome do not seem to
have this problem at all.  Also, the bug only shows up in SVG-Edit version
2.4 branches.  SVG-Edit 2.3 works fine in Firefox.  

Original issue reported on code.google.com by breit...@gmail.com on 9 Dec 2009 at 1:30

GoogleCodeExporter commented 9 years ago
Hi again,

Same as for issue 352, I cannot reproduce this with the current SVG-edit trunk 
in
Firefoxes. My guess is that "somehow" you managed to break something, which then
broke the Text tool.
It would be interesting to know what, because the "steps to reproduce" mentioned
above aren't sufficient (for me) to break SVG-edit.

When this occurs, it would be interesting to open the Firefox error console 
(Tools /
Error console) and see if you have errors (the ones in red) there.

Original comment by worms_...@yahoo.com on 9 Dec 2009 at 11:02

GoogleCodeExporter commented 9 years ago
Hi, thanks for taking a look at this.  So we're using SVG-Edit in a learning
environment for high school and middle school students.  I didn't notice this 
bug
until seeing it happen in the classrooms with the students.  But I was then 
able to
reproduce it in my own testing yesterday.  The interesting thing is that it not 
only
happens on my local installations (the latest trunk included), but also when 
viewing
the 2.4 alpha and trunk demos that are linked on the SVG-Edit Google Code page. 
 And
we've tested on many different machines and operating systems and they all seem 
to
exhibit the same problem.

Anyways, I did some debugging and found that a javascript error is thrown if 
the text
is completely cleared from the input box and then the user attempts to enter 
more
text: "elem.getBBox() is null" in svgcanvas.js at line 5462 (current trunk). 
Specifically, this is in the changeSelectedAttributeNoUndo function.  If the
attribute is of type "text", the function does this: var old_w =
elem.getBBox().width.  So basically, it looks like the function breaks when the
rounding box for the text object is null.

As a temporary workaround, I just added a check here to see if elem.getBBox() is
null.  If it is, then I don't execute "var old_w = elem.getBBox().width".  So 
far,
this seems to have fixed the problem and the text tool operates correctly.

[As an aside, I really wanted to thank the developers for such an amazing tool! 
 Like
I said, we're using a modified version of SVG-Edit in our virtual learning
environment.  It's replaced an old Java drawing tool we developed years ago 
that ran
in an applet and was slow and limited in functionality.  SVG-Edit is amazingly 
fast,
extendable, and fits really well in our new Javascript-based environment.]

Original comment by breit...@gmail.com on 9 Dec 2009 at 5:53

GoogleCodeExporter commented 9 years ago
Just out of curiosity, could you check, compared to this screenshot:

http://imgh.us/trunk_link_2009_12_09.jpg

what SVG-edit "look" you get when you use the "trunk build" link from our home 
page?
( http://svg-edit.googlecode.com/svn/trunk/editor/svg-editor.html )

There are three things to check:
- the icons on the left,
- does your Layer panel get a handle?
- what does "Powered by"... 2.4... say, "alpha" or "unstable"?

So, for both browses, the URL is the same, but SeaMonkey and Firefox do not 
show the
same version. 

SeaMonkey has a browser.cache.check_doc_frequency set to 3 (the default). It 
shows
the "new" SVG icons, and says "2.4 alpha". The Layer panel gets the handle. 
After a
"hard" refresh, I still see the same, and, "good news", I can reproduce issue 
352 on it.

Firefox has a browser.cache.check_doc_frequency set to 1 (always check for a new
version). Even after a "hard" refresh, it shows the "old" layout for icons, the
Square instead of the Rectangle. The Layer panel shows no handle, and it says 
2.4
unstable.
On that, the issue doesn't exist.

On a local copy of the latest trunk build, as I said before, everything is 
"normal"
and I cannot reproduce the issue.

Original comment by worms_...@yahoo.com on 9 Dec 2009 at 7:07

GoogleCodeExporter commented 9 years ago
I'd fixed this recently, but only for the fixtransforms branch (should have 
left that
issue open I guess). As of r1005 the fix has also been applied to the trunk.

Thanks breity10 for reporting it, and great to hear SVG-Edit is being used the 
way it
is! That's awesome news and encouraging for us to work harder at making the best
web-based SVG editor we can. Don't hesitate to open any new issues on bugs you 
find
or suggestions you may have on how we can improve SVG-Edit.

Original comment by adeve...@gmail.com on 9 Dec 2009 at 7:12

GoogleCodeExporter commented 9 years ago
breity10 - wow that is really cool news!  I guess this is some internal system 
and
not something that we can see screenshots of, etc?  That's ok if it is just
excited/curious.

Of course if you are interested in contributing any of your changes back to the
project, they would also be highly appreciated.

One note: we are still in an 'alpha' phase of 2.4 so that trunk may occasionally
become unstable.  I would suggest sticking to a version of the editor either by
sticking to the official Alpha version or a particular revision that you've 
tested
thoroughly.  You can do the latter by doing this:

http://svg-edit.googlecode.com/svn-history/r1005/trunk/editor/svg-editor.html

(I am not endorsing r1005 as any more stable than r1004, this is just an 
example)

On the other hand, we really appreciate the bug reporting and the news that 
SVG-edit
is being used in a new way.  That type of information really fuels us onwards as
adaveria says.

Original comment by codedr...@gmail.com on 9 Dec 2009 at 7:25

GoogleCodeExporter commented 9 years ago
Great!  r1005 (and r1006 & r1007) seem to be working correctly now.  Thanks so 
much
for your help on this.

Yes, we're currently using a particular version for our tool (one from the end 
of
October).  But I will work on migrating our modified tool to probably r1007 in 
the
next few days so that the newest fixes are there.

As for our implementation, you can definitely check out our project!  We are a
research group at the University of California, Berkeley and our learning 
environment
is called WISE (Web-based Inquiry Science Environment, 
http://wise.berkeley.edu). 
WISE is freely available for anyone to use and our work is all open source as 
well. 
The WISE project has been operating in some way or another for over 15 years 
now and
we also lead a larger consortium of research institutions called TELS 
(Technology
Enhanced Learning in Science, http://telscenter.org).

Our original learning environment (that was developed over the last decade) is
available at the WISE website above, but our development team has done a huge 
rebuild
of the system that we are now piloting in several middle schools and high 
schools. 
The new system is now Javascript/Ajax driven and you can check out previews of 
some
of our curriculum projects here (http://wise4.telscenter.org).  Eventually, we 
will
be largely moving over to this new system, probably by Fall of 2010.

Each of our curriculum projects is made up of different activities and steps 
that the
students navigate through and complete.  One of those step types is a drawing 
tool -
so the project will ask students to create drawings of different concepts and 
reflect
on them.  So I've basically taken SVG-Edit and modified it a bit for our 
purposes -
removing/hiding some options for simplicity sake, integrating SVG-Edit steps 
into our
data storage mechanisms (so student drawings are saved along with all the other
student work), etc.

If you'd like to see an example of SVG-Edit integrated into one of our 
projects, go
to http://wise4.telscenter.org, click on "Preview Projects" and then open up the
"CLEAR Plate Tectonics" project near the top. Step 5.3 "Build a Model" is an 
SVG-Edit
step!

We're also working on a few extensions to the tool.  For example, I've modified 
the
image tool and turned into what we call a "stamp" tool.  Basically, the project
author can specify specific images beforehand (we load these from a simple json 
file)
for students to choose from.  The students can select an image they want to use 
and
then add it to the canvas.  We're also using the layer functionality, for 
example, to
allow curriculu, authors to specify background drawings that appear by default 
when a
student comes to a specific drawing step.

Anyway, thanks your quick responses to these issues and your amazing work.  
We'll
definitely keep in touch and would love to talk more with you about the 
development
of SVG-Edit, keep you updated on how we're using it, etc. in the future.  
Thanks again!

Original comment by breit...@gmail.com on 9 Dec 2009 at 10:57