FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

slipping away

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Sun May 13, 2007 9:06 am    Post subject: slipping away Reply with quote

Hi all!

First of all, thanks for you effort! ArcLib is really fun to play with!

But, while playing, I got a somewhat weird problem:
The content of my window is slipping away Shocked (to the left btw.)
see here:
http://img502.imageshack.us/my.php?image=slipiu1.jpg

Maybe some error by int<->float conversion (rounding)?
I tried putting position statements everywhere, but to no avail.

Any ideas?

I packed it all up in a "ready-to-run" package (Windows, 1.41MB) including source at
http://www.savefile.com/files/718307

(pw is 'arclib')


regards, david


ps:
just some ideas, don't know if its reasonable/I understood it right/its already planned:
    readonly (ml)textboxes (property bool readOnly or so) (i.e. no change by user and no cursor and no focus)
    alignment in (ml)textboxes (not alway centered), or a property "bool justText" or similar which just lists text aligned at the upper left corner (check for that would be in process() "Point targetPos = ..." I believe)
    setText(): shouldn't that assert be
    assert(lines.length <= 1, "TextBox does not allow multiline, use MLTextBox");
    instead of "!= 1" ?
    setText() automatically changes the width according to the text, should be able to turn that off
    Widget/textbox should have a "getText()", to bring textbox to use
    it's somewhat irritating at first to do a
    drawRectangle(Point(45, 45), Point(710, 470), Color(255,255,255,55),true);
    but the second Point is not the other corner but width/height, perhaps an "alias Point Size" (or is s.th. like that already there and I just didn't see it?) that would be used in example code to state the intent more clearly?


Last edited by davidb on Tue May 15, 2007 2:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sun May 13, 2007 10:25 am    Post subject: Reply with quote

I downloaded the file but the archive seems to be password protected.

I'm also going to disappear until the 19th of may pretty soon, so sorry if it takes a while for this problem to be resolved.

While the GUI is already in pretty good condition (except MLTextBox) it is not planned to be fully robust until Arc v.3.

I'm not sure I quite understand the problem however.

Right now the font is designed so that when the text gets past the window it wraps around, is this the problem?

I know Christian also made some recent changes to the way virtual coordinates operate, so maybe he can shed some light on this.

g2g
~ Clay
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Sun May 13, 2007 10:39 am    Post subject: Reply with quote

> (pw is 'arclib')

I forgot to say: when you have started it, the problem doesn't appear until after you have pressed "connect" (connects to irc server and starts printing the messages). After a few seconds you can see the effect.

david
Back to top
View user's profile Send private message
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Sun May 13, 2007 11:20 am    Post subject: Reply with quote

Looks like a bug with the changes to the coordinate system. I'll look into it. You aren't using arc.window.coordinates.origin, by any chance?

EDIT:
I tried it and can't reproduce the problem. Connecting works and the window and text all stay stationary. Try deleting all object files and rebuilding? I am on linux though.

Quote:
it's somewhat irritating at first to do a
drawRectangle(Point(45, 45), Point(710, 470), Color(255,255,255,55),true);
but the second Point is not the other corner but width/height, perhaps an "alias Point Size" (or is s.th. like that already there and I just didn't see it?) that would be used in example code to state the intent more clearly?


I agree about that. A size is not a point, so I'm thinking about adding a Size struct - that'd also make it possible to have
Code:
drawRectangle(Point, Size) // Point and size for rect and
drawRectangle(Point, Point) // top-left and lower-right

though in this case, we'd probably better switch to
Code:
drawRectangle(Rect)

to avoid having to provide lots of overloads everywhere. However, user code then becomes
Code:
drawRectangle(Rect(Point(0,100), Size(100,100)));

which is arguably a bit nested.
Back to top
View user's profile Send private message
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Sun May 13, 2007 12:21 pm    Post subject: Reply with quote

> arc.window.coordinates.origin
no, I'm not using that

> Try deleting all object files and rebuilding?
so far, i compiled with
rebuild ircgui -clean -full -debug ws2_32.lib
(no -gui to see errormsg, but adding -gui has no effect)

Perhaps a Windows thing? Never encountered something like that, though.

> I'm not sure I quite understand the problem however.
After the text is printed, every few seconds the window content shifts a pixel or so to the left, see the picture I posted for the state after two minutes or so.


david
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sun May 13, 2007 6:27 pm    Post subject: Reply with quote

Alright, I typed the pw to get the files and I ran the program.

I connected, and waited 3-5 minutes, and the context has not shifted left on me. I'm using the exe you have provided.

Can you try running other non-fullscreen OpenGL programs and see if you get the same effect?
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Mon May 14, 2007 12:45 pm    Post subject: Reply with quote

Thanks for looking into this.

Just tested an old arc prog I wrote that also got some font output but there I don't have the problem (neither the old compiled exe nor the to the recent svn updated program).
Also, no change in ircgui if I disable the background (meaning still slipping away).

Should I keep minimum distances on certain coordinates?
(in layout arrangement, background position, background imagesize?)
Never mattered so far as long as bounds were respected, just an idea.

david
Back to top
View user's profile Send private message
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Mon May 14, 2007 1:18 pm    Post subject: Reply with quote

EDIT:
I looked through the relevant code and fixed a possible rounding bug in a function called from arc.font.drawMulti. Check out the latest revision from svn and try again!

Before the edit:
Since Clay and me can't reproduce this bug you'll have to try to find it on your own. Removing the background was a good idea.

A good next step would be to remove the IRC functionality and try if it also happens with only the multi-line textbox. Maybe it occurs only with certain texts, as Clay and me got different ones from yours?
Back to top
View user's profile Send private message
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Mon May 14, 2007 4:36 pm    Post subject: Reply with quote

ChristianK wrote:
EDIT:
I looked through the relevant code and fixed a possible rounding bug in a function called from arc.font.drawMulti. Check out the latest revision from svn and try again!


Just got home, one repo checkout and everything works fine!!
Thanks a lot for your time, I really appreciate it!


regards, david
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu May 24, 2007 5:21 pm    Post subject: Reply with quote

You can now use Point and Size interchangibly.

Point a;

Size b;

a.x = 5; a.y = 10;

writefln(a.w, a.h); // writes 5 and 10

b = a;

writefln(a.w, a.h); // writes 5 and 10
Back to top
View user's profile Send private message AIM Address
yinqiaol
Guest





PostPosted: Thu Feb 10, 2011 7:39 pm    Post subject: Reply with quote

Well this is a good site
Back to top
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group