Discarding the last TextLine and trying again with a new width
Hi all,
I'm using TextBlock to create a paragraph. This paragraph has regions which do not render any text (so that I could put some images down within the generated text in a way more similiar to CSS float styles. BTW, I'm not trying to achieve an inline image rendering; I know that is possble already with TextBlock).
So, my problem:
If one of these 'block out' regions are close to the boundary of the overall paragraph region, then this is the result:
In the left column, because those words are not broken on natural word breaks, createTextLine results in TextLineCreationResult.EMERGENCY.
That's great--I can detect this situation from the API. However, I can't figure out what to do once I'm aware of it!
What I want to do is this: I want to throw away any EMERGENCY TextLine (I've tried releaseLines), and then 'rewind' one createTextLine attempt so that I can try to generate the next TextLine using the same context as before the EMERGENCY failed attempt.
For clarity, this would mean in the above image, I'd hope to just discard the 'achi', 'year', 'repr', 'won', 'digr', 'prog', 'achi' TextLines on that thin left column... meaning only whitespace would occur in that thin column. On the first line of the right of that skipped block, you'd see 'achievement' on the first broken line, because the 'achi' would be considered during the next createTextLine() attempt.
Regards,
Seth
Hi Robin,
So, that's exactly what I was trying to do, or so I thought. Your example forced me to look at my code harder... here's the moral of the story. The structure of my code processing the TextLines was like so:
if
// attempt create textLine
else if (condition = emergency)
// discard line, don't set previous
else (textLine != null)
// keep line, place it on stage, and set previousLine to the newly created one
Notice the oddity... I put a condition on the else statement! Putting a condition on an else statement causes to behave like an else/if (so I just learned). I had done some refactoring and left the condition on the else statement by accident, so both the else if and else statement were executing!! This caused my emergency block to be 'persisted' into the textblock instead of discarded.
Thanks for your help Robin,
Seth
Similar Messages
-
I can no longer use Macmail for my btinternet account. I was advised to delete the imap account and begin again with a pop account for incoming mail. My Macbook will not let me do that and neither BT nor Yahoo have been able to help.
Btinternet being your internet service provider? If I'm correct, have you followed their directions:
http://btbusiness.custhelp.com/app/answers/detail/a_id/7073/c/2048,2053,3883,206 5
Just found a seemingly newer article (and there are several more on the right of those pages):
http://btbusiness.custhelp.com/app/answers/detail/a_id/7071/related/1/session/L2 F2LzEvdGltZS8xMzU0NzI1NTMyL3NpZC9qaThFVi1jbA%3D%3D -
I have deleted the contact, rebooted, changed the contact name and added the ten-digit number. Send Message reverts to the old contact name, refusing to recognize the new contact name, or the ten-digit number. How do I overcome this sticky piece of messaging memory? I have an iPhone 4 with iOS7.
The fix for this problem is easy and is set out here: http://edctips.blogspot.com/2014/09/fixing-iphone-texting-problem.html
-
How can I cancel my payments?
Cancel your membership or subscription | Creative Cloud
https://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html -
I was trying to add and app to my iphone and was not able to do so. It wanted updated credit information. So, I entered it and it will not accept the month of experation. I have shut the phone down, sync it to the computer to update. Will not work. What can I do to continue?
Off the top I dont thing its good practice to post an email address here
I dont see how a google password change would impact on ur Apple ID/iTunes account
Have u access to the old email address? If not and you fail the apple security process then you need to call them
Have u tried to manage ur apple id from : appleid.apple.com -
please help.
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
http://tinyurl.com/32drz3d
Cheers, Tom -
Itunes Match won't upload. I get error stating there was an error in the itunes store, please try again. I have tried again everyday for the last month and am still unable to use. Any ideas on why Match can't complete the 1st step of the process (Gathering information about your Itunes library)?
JohnCullison wrote:
For the last few weeks, the iTunes store has been displayed with empty graphic rectangles (with a blue box containing a white question mark centered in the rectangles), bits of text, and some buttons. The page extends quite a ways, including what I assume would be all the links to all the music...
If all you are trying to do is buy music, you can easily buy MP3s at any online music download store (e.g. amazon.com) and add them to your iTunes library. -
I had to reset my phone and I only have one of my ringtones I had 4.. Why'd it delete 3 and not the last one and now I can't get em back without paying for them again!!! What the **** is up with that??
Yup, your question and Diane's answer helped me also. Tho' I had had problems before getting into the iTunes store I always managed to find a way. Today they had me blocked cold with the "Update to 10" advert no matter what I did. Other questioners are being told, incorrectly as it turns out, that they have to update their OS to accomodate iTunes 10 and upgrade to iTunes 10. I did the download which did not take up much more room on my crowded old hard drive and now I'm back in business.
-
i have a wd my passport which for the last year i was using with my windows pc...but recently i bought a macbook and was trying too put files on it but it wouldnt work....please help!!!
Hi
You need to find the format of the drive by looking at its info, my guess would be you are currently in NTFS (windows only) mac can use any mac os journaled or non journaled, or you can use fat32 which is usable on both pc and mac but is unable to move files over 4GB so no good for large file transfers. You will need to re format at some point but this will delete everything currently on the drive.
Hope this helps -
I have an error when installing apps on my mac from the apple store. It says "return to the purchase page and try again"... I think it is something to do with the installation process itself. I have tried to clear apple store cache, restarted apple store from debug menu, double checked my apple id account and etc..but doesn't work anyway.
I'm having the same problem and went as far as to delete and reinstall the AppStore and still no dice.
-
I have just installed the latest version of iTunes version 11.1.5.5, now I have no playlists. So I uninstalled and tried again, now I have no songs also! Also my account balance has gone down by approx £5, which incedently happened the last time I installed an update. Please help
See Empty/corrupt iTunes library after upgrade/crash.
tt2 -
Cannot install itunes 11.1.3 to my windows vista home premium 32-bit. After it finishes the download that it verifies the file I get a message saying "this file cannot be downloaded". What could the problem be??? I uninstalled my itunes and tried again and keep getting the same message. Please help !
See Troubleshooting issues with iTunes for Windows updates.
For downloading issues see the further information area and use a different browser and/or the direct links.
tt2 -
My Android Galaxy S5 has locked up and gone into endless loading while trying to update to the Kitkat update. I have set it back to factory settings and tried again and it has locked up again. My phone no longer works. What else can I do?
Oh goodness,SLEEPER888. We wish you didn't have this problem while trying to complete this update.You have done quite a bit of troubleshooting on your own. If the phone update does not take, we would need to replace it with the warranty. Is it still locked up?
TamaraH_VZW
Follow us on Twitter @VZWSupport -
I just upgraded my iPhone 3GS to 4.3.5 and my universal doc stopped working with it? It has worked flawlessly for the last year and suddenly I get the message: "this iphone is not optimized for this device." I dismiss the message, but the remote no longer works with it and the music is too quite to the speakers. The remote works fine with my Macbook Pro. I tried a restore on the iPhone and started from scrach, but the same problem exists.
Any help with this?
Thanks,
JTyep... my iphone 4 also having problem like astoker.. u see on dock pin using torch light.. i found 2 pin touch each other.. i solve my problem ready.. thanks wjosten.
-
I'm not able to update Smurf's Village. Tried most of the things proposed on the net including restarting the iPad and trying syncing with the computer. Had a similar issue with another application. Had to delete and reinstall it, with all history lost.
Tried following up with the developer's instruction. Didn't help. Developer suggested contacting Apple if their instruction didn't work. Tried the various methods recommended on the Apple site. Same result.Telling is that you tried most of the things on the net doesn't tell us exactly what you did try, so we are all still left to guess .....
Sign out of your account, restart the iPad and then sign in again.
Settings>Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
Go back to Settings>Store>Sign in and then try to update again
If that doesnt work - go to Settings>General>Date and Time - set the date ahead by a few months. Try to update again. If you get an error message of any kind - go back and change the date and time to automatic again. Then try again.
If that doesn't work, restart your router and reboot the iPad.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
Maybe you are looking for
-
How do I find out how much is left in my iTunes account? I've looked all over and can't find it! Help!
-
Mac programs for drawing or painting
Is there a free program for making drawings or paintings?
-
HT201269 i want connect my ipod to the itunes
i want to connect my ipod to the itunes because its atomatically off and its show me to connect with itunes so plz would u help me////
-
HDD boot broken, Linux usb works
<center> Windows 7 won't boot on HDD </center><n><p2> When I start it up on HDD, nothing runs. I cant see what's happened because NTFS isn't viewable on Linux. I installed Ubuntu on a hard drive partition and acer boot didn't recognize it as a diffe
-
Ipod won't connect via firewire, only usb
My clickwheel ipod decided to stop connecting via firewire. I reset it, and the restored it, and reinstalled itunes. Nothing worked. I then took out the USB cable from the box (for the first time in almost 3 years) and it works perfectly. While tryin