Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters flow out the line if wrapmode is nowrap #21

Open
hwsguy opened this issue Feb 12, 2018 · 7 comments
Open

Characters flow out the line if wrapmode is nowrap #21

hwsguy opened this issue Feb 12, 2018 · 7 comments
Assignees
Labels

Comments

@hwsguy
Copy link

hwsguy commented Feb 12, 2018

When the texteditor gadget has MUIV_TextEditor_WrapMode_NoWrap for wrapmode and moving the cursor to the right or left border make the content scroll one character the line does flow out the text area.

As the image shown:
https://s5.postimg.org/xwayj5xnb/textcraft.jpg

@tboeckel tboeckel self-assigned this Feb 13, 2018
@tboeckel tboeckel added the bug label Feb 13, 2018
@tboeckel
Copy link
Contributor

Is there any easy way to reproduce this issue? I mean without having to use Hollywood? A simple example in C perhaps?
Right now I am not able to reproduce the issue myself. On my setup everything is done right, the text is scrolled as expected without being drawn across the object's frame.

@tboeckel
Copy link
Contributor

tboeckel commented Mar 2, 2018

Any hint for me?

@alpyre
Copy link
Contributor

alpyre commented Mar 2, 2018

I am quite positive that this bug is because of an incompatibility with the layers.library on that system.
I remember seeing a similar issue on a Cybervision display (BVision actually) as I was testing the feature. It was fixed after updating the layers.library.

I suppose the culprit is this line:
mcc/PrintLineWithStyles.c

357    if(doublebuffer == FALSE)
358      AddClipping(data);

If the layer allocation (for the doublebuffering rastport) fails for some reason, you still have a doublebuffer rastport but a non layered one. So the above line decides not to AddClipping().

I hope this is a clue.

@tboeckel
Copy link
Contributor

Not exactly. The "doublebuffer" variable is a parameter passed to the PrintLine() function. Hence the calling function decides whether to use double buffering or not. But you are right, if installing the clipping region fails the rendering is done to the double buffered RastPort, but without clipping. And this perfecly explains the misbehaviour.
But the big question now is: why does this happen at all? The clipping region is installed by calling MUI_AddClipping() in a wrapper function which ensures that MUI_AddClipping() is called once only. The accompanying function RemClipping() is always called pairwise, so there cannot happen anything bad either.

Which version of layers.library are talking here about exactly? I am using layers.library 45.22 (3.10.2014), which is not even the latest version (http://aminet.net/util/sys/layers.lha).

@alpyre
Copy link
Contributor

alpyre commented Mar 13, 2018

Hmm. I went through the code once again and I think we both are wrong.

You're right about doublebuffer variable but, when PrintLine() caller decides to not use doublebuffering, the code then uses data->copyrp (which should be the objects rastport) with MUI_AddClipping() (not the other way around as you've stated).

And let's assume doublerp failed at initialization because of layers.library, then data->doublerp should be NULL and PrintLine() should again always fallback to use data->copyrp with MUI_AddClipping() (that's where I was wrong).

So whenever data->doublerp is not NULL (and PrintLine() is called with doublebuffer), such a behaviour can never occur. Because we always blit from the 0,0 coordinates of doublerp. It seems not possible to me.

So somethings must be going wrong in MUI_AddClipping() on that system. It maybe is again a layers.library issue if MUI_AddClipping() is depending on it.

@tboeckel
Copy link
Contributor

Sorry for the long delay.
Can you easily reproduce this issue? If yes, then I can provide special versions of TextEditor.mcc and muimaster.library (MUI5) for AmigaOS3/4 to check whether MUI_AddClipping() and MUI_RemClipping() are working as expected in that case.
Otherwise I don't know how to fix this issue, because I am not able to reproduce it right now.

@tboeckel
Copy link
Contributor

tboeckel commented Sep 8, 2020

Bump!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants