Re: [Tuxpaint-devel] Rendering of text when saving
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Pedersen, T. A. <tor...@he...> - 2008-07-24 18:18:36
|
Hi again! Here are some changes, I have more in mind, but not finished yet :)
About the cursor changes in mouse motion event, there should have been a cur_cursor to see if any changes of cursor is needed before it is changed. I don't know if it would be best to have some integer value for each cursor for the test of this. In that case, the integers used for TOOL_* could be reused as cursor for hit in canvas, so
if (cur_cursor != cur_tool) do_setcursor(cur_tool) would cover a lot of cases.
Also some places the cursor could be set inside an already existing test for cur_tool instead of in its own test. I'll have another look at this later.
the diff looks like below.
Yours sincerely
Tor Arne Pedersen
2380c2380
< {
---
> {
2398,2401c2398
< if (cur_tool == TOOL_TEXT && which != TOOL_TEXT &&
< which != TOOL_NEW && which != TOOL_OPEN &&
< which != TOOL_SAVE && which != TOOL_PRINT &&
< which != TOOL_QUIT)
---
> if (cur_tool == TOOL_TEXT)
2423,2425d2419
< // FIXME: this "if" is just plain gross
< if (cur_tool != TOOL_TEXT)
< draw_tux_text(tool_tux[cur_tool], tool_tips[cur_tool], 1);
2493c2487
< draw_tux_text(tool_tux[cur_tool], tool_tips[cur_tool], 1);
---
>
2575,2580c2569
<
< if (do_open() == 0)
< {
< if (old_tool == TOOL_TEXT)
< do_render_cur_text(0);
< }
---
> do_open();
2583d2571
<
2587d2574
<
2589d2575
<
2598,2599d2583
< else if (cur_tool == TOOL_TEXT)
< draw_fonts();
2628,2629d2611
< cur_tool = old_tool;
<
2631,2633d2612
<
< if (cur_tool == TOOL_TEXT)
< do_render_cur_text(0);
2637d2615
<
2639d2616
<
2659,2666d2635
< /* If they haven't hit [Enter], but clicked 'Print', add their text now -bjk 2007.10.25 */
< if (old_tool == TOOL_TEXT && texttool_len > 0)
< {
< rec_undo_buffer();
< do_render_cur_text(1);
< texttool_len = 0;
< cursor_textwidth = 0;
< }
2682a2652
> draw_tux_text(tool_tux[cur_tool], tool_tips[cur_tool], 1);
-----Opprinnelig melding-----
Fra: tux...@li... på vegne av Bill Kendrick
Sendt: on 23.07.2008 22:37
Til: Discussion list for Tux Paint developers
Emne: Re: [Tuxpaint-devel] Rendering of text when saving
Hi Tor, thanks. Yeah, that's a bug. Feel free to post the changes
you made, or point me to the particular line of code, if you can.
I fixed this for Print, since a lot of students were having
problems in classes, but obviously didn't do Save. :^/
As for switch/case, I personally never liked those, and never got into using
them.
On Wed, Jul 23, 2008 at 08:06:51PM +0200, Pedersen, Tor Arne wrote:
> Hello,
> Thanks for a great application for my children. I would love to help out
> with this project if any more hands are needed.
>
> I had an issue with the text not being rendered when save was hit, so I
> read the code and found that this was done intentionally by doing a if
> cur_tool != lots-of-tools {render current text}. Also a few lines down,
> some text are rendered anyway. Why this behaviour? I changed it in my
> local copy of the code to render the text if any tools were clicked. Even
> hitting Text-tool again should render the current text, in my opinion.
>
> While I looked for the solution of the issue described above, I found some
> lines marked fix-me, and I also found a couple of places that should have
> had a fix-me-marking :) Some of this I can fix. Can I just do it, and
> where should I post suggested changes?
>
> I was also wondering if it would be better to swap some if-elses with
> switch cases, especially for those with 6-7 or even 12 tests.
>
> Yours,
> Tor Arne Pedersen
-bill!
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tuxpaint-devel mailing list
Tux...@li...
https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel
|