Bounds bug in Java2D using LineBreakMeasurer

I'm having big problems bounding() in Java2d with LineBreakMeasurer.
Anyone have any ideas? The Rectangle drawn doesn't sit on the string like it should. The bounds method normally works ok. I think its maybe this bug..
http://bugs.sun.com/bugdatabase/view...bug_id=4463424
Anyone able to code me a workaround to this please?
Font font = new Font(layMod.getBotName_fontName(), layMod.getBotName_fontWeight(),
layMod.getBotName_fontSize());
g2d.setColor(Color.BLACK);
g2d.setFont(font);
FontRenderContext frc= g2d.getFontRenderContext();
TextLayout layout = new TextLayout("Some text", font, frc);
AttributedString astr = new AttributedString("Some text");
astr.addAttribute(TextAttribute.FONT, font);
AttributedCharacterIterator paragraph = astr.getIterator();
frc = g2d.getFontRenderContext();
LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(paragraph, new FontRenderContext(null, false, false));
int paragraphStart = paragraph.getBeginIndex();
int paragraphEnd = paragraph.getEndIndex();
Dimension size = r2d.getBounds().getSize();
float formatWidth = (float) size.width;
float drawPosY = layMod.getBotName_y_position()*scalar;
lineMeasurer.setPosition(paragraphStart);
while (lineMeasurer.getPosition() < paragraphEnd) {
layout = lineMeasurer.nextLayout(formatWidth);
drawPosY += layout.getAscent();
float drawPosX;
if (layout.isLeftToRight()) {
drawPosX = layMod.getBotName_x_position()*scalar;
else {
drawPosX = formatWidth - layout.getAdvance();
layout.draw(g2d, drawPosX, drawPosY);
drawPosY += layout.getDescent() +
layout.getLeading();
}

I'm still stuck on this, I have some Text, which I want to test for a mouseclick eventually. I want to be able to draw a rectangle around the bounds of the text, and use this as my target area for testing for mouseclicks. The idea is to make the text draggable, but I can't seem to get beyond this rectangle not being drawn in the right place part of the problem!
The articles were helpful, I've tried to relate them to my problems. But i'm stuck still!
How to get the bounds of a piece of broken text created by LineBreakMeasurer and put a rectangle around them.
Any advice incredibly appreciated.

Similar Messages

  • Bug in java2D rendering without AA

    I think I found a bug in java2D rendering when not using AA, shapes move up and to the left when alpha other than 1 is used.
    I will file a bug report at some point, but I want to talk about it here first.
    To reproduce:
    g2.drawLine(0,0,10,10);
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
    g2.drawLine(0,0,10,10);lines will not be the same.
    However there are several rendering hints that have an effect on the bug, so I created a test program to facilitate more complete testing.
    [here it is.|http://www.mediafire.com/file/nunninzinot/J2Dbug.jar]
    If any one could run it for me and tell me what happens on what os/jvm I would be most grateful.
    The source is also in the jar.
    I have tested the following os/jvm combos, problem shows up on all of them.
    vista32 sun 1.6.0.15_0 or something.
    winxp32 sun don't know.
    ubuntu64 OpenJDK 64-Bit Server VM 1.6.0_0.

    Alright after trying hundreds of combinations and restarting between several of them I've discovered that molecule will work on my card if at least one of the following are met:
    1. -wireframe is specified
    2. -no-labels is specified
    In molecule.c the draw_labels function disables lighting on line 1346 if wireframe is off and enables it again on 1415. Something about turning lighting on and off too quickly might hang my card.

  • [svn:fx-trunk] 7155: Line bug fixes when using gradient strokes

    Revision: 7155
    Author:   [email protected]
    Date:     2009-05-20 14:39:39 -0700 (Wed, 20 May 2009)
    Log Message:
    Line bug fixes when using gradient strokes
    SDK-21272 - Lines with gradient (LinearGradientStroke) draw as solid color if perfectly vertical / horizontal
    StrokedElement was not taking the stroke weight into account when passing the bounds to the stroke. The gradient strokes rely on the bounds to help them transform the gradient to fit the shape of the stroke.
    SDK-21274 - Line with gradient stroke does not draw properly
    This bug occurs when the Line has a non-zero x and/or y values and is sharing a DisplayObject. StrokedElement was passing the stroke the measuredX and measuredY position as part of the bounds. Instead, I've changed it to pass in drawX + measuredX and drawY + measuredY which accounts for the drawing offset position.
    QE Notes: Test Line w/ gradient strokes
    Doc Notes: None
    Bugs: SDK-21272, SDK-21274
    Reviewer: Evtim
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21272
        http://bugs.adobe.com/jira/browse/SDK-21274
        http://bugs.adobe.com/jira/browse/SDK-21272
        http://bugs.adobe.com/jira/browse/SDK-21274
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/StrokedEleme nt.as

    This bug figures out also when creating a custom spark ComboBox, then trying to programatically update the userProposedSelectedIndex property. The proposed selected index is selected, but does not apply the same skin as when mouse is on rollover or item is selected due to up and down keys.
    The issue seems like updating the status of the item renderer to rollover or selected to get the same skin applied.
    Please could you attach DropDow nList.as that you edited ?
    Thank you so much.

  • [svn:bz-trunk] 17010: Bug: Watson #2652870 - use a property file to drive the custom configuration tokens as opposed to setting it in the command line

    Revision: 17010
    Revision: 17010
    Author:   [email protected]
    Date:     2010-07-22 02:52:41 -0700 (Thu, 22 Jul 2010)
    Log Message:
    Bug: Watson #2652870 - use a property file to drive the custom configuration tokens as opposed to setting it in the command line
    QA: Yes
    Doc: Yes - in custom tokens section, talk about the new token.file option
    Checkintests: Pass
    Details: Changed TokenReplacer to look for a token.file JVM option. If it's specified (eg. -Dtoken.file=/User/matamel/Desktop/token.properties), then TokenReplacer looks for a properties file where token name and values are specified. This allows someone to specify a file for custom tokens. Custom tokens can still be specified as straight JVM option and in case where a token is defined both as a JVM option and in a token properties file, JVM option takes precedence.
    Modified Paths:
        blazeds/trunk/modules/common/src/flex/messaging/config/TokenReplacer.java

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • Using LineBreakMeasurer causes line to break badly

    Hello all
    I'm having a problem with some printing code. First I determine the min/maxs required to display some column data using <metrics>.stringWidth(). Once I figure out how much space can be in a column I go through and use LineBreakMeasurer to format each line to within the specified column space. Unfortunately in one instance the data is being broken when it shouldn't. Here are the routines...
        int breakLines(final String text, final float width, final Font font,
                          final ArrayList list)
            if (0 < text.length()) {
             final String[] tokens = text.split("\\\n");
             for (int i = 0; i < tokens.length; i++) {
              final AttributedString attText = new AttributedString(tokens);
         attText.addAttribute(TextAttribute.FONT, font);
         final LineBreakMeasurer lineBreaker =
    new LineBreakMeasurer(attText.getIterator(),
                                       new FontRenderContext(null, true, true));
                   TextLayout layout = lineBreaker.nextLayout(width);
                   do {
                        list.add(layout);
                        layout = lineBreaker.nextLayout(width);
                   } while (null != layout);
         return list.size();

    Okay - the editor messed me up. Took my partial e-mail and posted it.
    Here's the code (again).
        private void findMinMax(final int idx, final String text,
                  final FontMetrics metrics)
            double width = metrics.stringWidth(text);
            mMax[idx] = Math.max(mMax[idx], (int)Math.ceil(X_PAD + width));
            final String[] tokens = text.split(" ");
            for (int i = 0; i < tokens.length; i++) {
             width = metrics.stringWidth(tokens);
         mMin[idx] = Math.max(mMin[idx], (int)Math.ceil(X_PAD + width));
    int breakLines(final String text, final float width, final Font font,
                   final ArrayList list)
    if (0 < text.length()) {
         final String[] tokens = text.split("\\\n");
         for (int i = 0; i < tokens.length; i++) {
         final AttributedString attText = new AttributedString(tokens[i]);
         attText.addAttribute(TextAttribute.FONT, font);
         final LineBreakMeasurer lineBreaker =
              new LineBreakMeasurer(attText.getIterator(),
                        new FontRenderContext(null, true, true));
         TextLayout layout = lineBreaker.nextLayout(width);
    do {
         list.add(layout);
         layout = lineBreaker.nextLayout(width);
         } while (null != layout);
    return list.size();
    The problem is when a single word is the only string in a column (like "Sticks"). The last character 's' is ending up on another line!
    Why? The 'width' passed in is the value determined from 'findMinMax' minus the X_PAD. The metrics passed into 'findMinMax' are metrics retrieved using the font passed into 'breakLines'.
    Any help appreciated.
    Lori <*>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • [svn:fx-trunk] 5812: Fixed a bug where direct use of Animation failed because AnimationProperty was not setting up its internal keyframes with correct duration information , so the animation would skip immediately to the end.

    Revision: 5812
    Author: [email protected]
    Date: 2009-03-31 11:34:56 -0700 (Tue, 31 Mar 2009)
    Log Message:
    Fixed a bug where direct use of Animation failed because AnimationProperty was not setting up its internal keyframes with correct duration information, so the animation would skip immediately to the end.
    Bugs: SDK-20356
    QE Notes: spark/effects Mustella tests currently hosed, couldn't run test suite
    Doc Notes: None
    Reviewer: Jason
    Testing: checkintests, Mustella effects tests could not be run (post-rename issues)
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-20356
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateColorIns tance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTr ansitionInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance. as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Rotate3DInstanc e.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RotateInstance. as

    Hi
    Can you please try setting up full persmission in the security properties for everyone on the wsconfig folder C:\ColdFusion10\config\wsconfig  and restart ColdFusion Server.
    Swaraj

  • TS4611 do 2013 ipads have the same bug hampering internet use as mac air?

    do 2013 ipads have the same bug hampering internet use as mac air?

    I couldn't get my internet to hold at home on my new MacBook Air though it worked in other places and this is what I was told (p.s. the update seems to have worked and everything is running smoothly now):
    Some MacBook Air (Mid 2013) computers may encounter an issue that, in rare instances, may cause an intermittent loss in wireless connectivity. The Wi-Fi menu bar icon may or may not indicate that a wireless connection still exists.
    Resolution
    Install MacBook Air (Mid 2013) Software Update 1.0 by running Software Update, or by downloading the update directly.

  • Bug report: Firefox5 uses the wrong unicode fonts (tested on Hebrew fonts)

    Even though the css defines the fonts as
    font-family: Arial,Helvetica,sans-serif;
    Firefox5 which I have just upgraded to does not use the Hebrew Ariel font but goes for the first Hebrew font it finds installed on my system. In my case it's a font family called TheSmokerSerif, but since this is not a system font I assume this issue would be encountered by other users too.
    I recommend updating FF5 with a bugfix soon as this is bound to affect many unicode sites and would render Firefox5 unreadable (literally)

    I am also experiencing this annoying issue in FF5. On some websites (usbank.com, tweetdeck.com, for example), the primary Helvetica/Arial fonts are being replaced with the first Helvetica font it finds in my Windows fonts folder. As a result, ALL text on the screen was using some ultra wide + bold Helvetica font and near impossible to read.
    It took me a while to track it down, but after finding and manually DELETING the wrong Helvetica font being used from the Windows fonts folder, I restarted Firefox, and then the main font was replaced with some Ultra Light variant of Helvetica (the next font in line). I then deleted THAT font, restarted, and now websites are displaying correctly again.
    This is pretty annoying, as somehow the two Helvetica fonts I deleted are being automatically reinstalled on my system after a day or two. And when this happens, Firefox starts using the wrong Helvetica fonts again.
    Unfortunately I JUST fixed it again otherwise I would provide a picture or two. But I searched for "Firefox using wrong helvetica font" in Google and found this support thread.
    I hope this bug gets resolved very soon!
    (Using Windows 7 Professional on Core i5 notebook w/4gb ram)

  • Bug or feature : Using portlets with edit mode on a page in the portal

    Hi,
    i am using Workshop 8.1 (GA release july) and i have discovered a bug (or a
    feature) with respect to the beta version.
    i have created a simple portlet with a view mode and an edit mode. When i
    place the portlet on the very first page of a one book portal, it works
    perfectly. However, i have a book with three pages and placed the portlet on
    the second page. Now when i put the portlet in edit mode, by clicking the
    edit button, i am directed to the first page of the portal and the portlet
    will not show.
    Inspection learned that the URL generated for the edit button, didn't
    contain the _pagelabel parameter. When i added the parameter manually it
    works fine.
    A final remark is that the buttons in the titlebar have no icons the browser
    can load.
    hope someone can help me out,
    Lodewijk

    Can you please post this question to weblogic.developer.interest.portal
    newsgroup.
    Thanks
    "Lodewijk Spijker" <[email protected]> wrote in message
    news:3f165945$[email protected]..
    Hi,
    i am using Workshop 8.1 (GA release july) and i have discovered a bug (ora
    feature) with respect to the beta version.
    i have created a simple portlet with a view mode and an edit mode. When i
    place the portlet on the very first page of a one book portal, it works
    perfectly. However, i have a book with three pages and placed the portleton
    the second page. Now when i put the portlet in edit mode, by clicking the
    edit button, i am directed to the first page of the portal and the portlet
    will not show.
    Inspection learned that the URL generated for the edit button, didn't
    contain the _pagelabel parameter. When i added the parameter manually it
    works fine.
    A final remark is that the buttons in the titlebar have no icons thebrowser
    can load.
    hope someone can help me out,
    Lodewijk

  • AE CS6 bug: Can't use any shortcut that includes the C in it

    A while ago I started having some issues In Illustrator CS6, where I couldn't copy and paste from one document/application to another, the issue later ported itself to AE and not much after that anything including the C key stopped working. For example I can't copy, pre compose or create a camera using shortcuts.
    After a lot of troubleshooting I was able to isolate a preference pane who was causing the Illustrator issue, I removed it and AI went back to normal, I assumed After Effects would be fixed too but unfortunately that's not the case, I still can't use the C key.
    I ran Onyx thoroughly, trashed AE's prefs, removed some recently acquired scripts, removed some login items and trashed those prefs also (I read a thread that mentioned those items could be causing odd behaviors).
    I carefully compared my setup against my laptop, which also has AE CS6 installed and working perfectly, I have the same scripts, the same preferences and the only login items not installed there are the ones that's are grayed out in my imac, so I can't delete them.
    If someone can help with this I'll be very grateful, I'm wasting a lot of time trying to solve this thing and I'm very used to using said shortcuts to increase my workflow.
    Thanks.

    I quit a few other components, a small utility called Shortcut (isn't that ironic?) and another one called MacAppBlocker,
    I still can't pre compose any layers using command-shift-c
    I was able to create a camera using command-shift-alt-c, after several tries, sometimes it worked, sometimes it didn't.
    I was being able to copy and paste across different programs and layers all sorts of objects, UNTIL  I opened Illustrator and copied a path, then I pasted it into a solid in AE.
    The next time I tried to copy something else, my clipboard got stuck with the path from Illustrator, EVEN inside illustrator.
    Greg, as you can see from this thread:
    http://forums.adobe.com/message/4462265
    This is an aknowledged bug from Illustrator, but as I have discovered in the past few days it's affecting everything systemwise, what are the possibilities that the only shortcuts that are failing are those that contain the combination of command-c? And like I said, it starts missbehaving right after I copy a path in Illustrator, not before.
    Alright, after some further testing, here's what I found:
    I removed (completely deleted) from my computer a small piece of software called WD Quickview, right after I was able to precomp and create cameras in AE.
    I still have the copy/paste issue from Illustrator, right after I copy a path, the clipboard goes haywire system wide.
    The strange thing is that, such program, WD Quickview has been installed on my computer for over a year now and never had any trouble with it, moreover, I'm not entirely sure how am I going to be able to get into the drive that uses that program (WD force-install that thing with their new drives that come with a new unerasable firmware).
    Coincidentally, I haven't plug the drive at all this week, so perhaps the program went crazy when it couldn't find the drive?
    Message was edited by: David Cabestany
    Ooooops. spoke to soon, this morning the issue came back.
    Message was edited by: David Cabestany

  • SMTP Bug in Mail using Gmail?

    I have numerous gmail accounts set up in Mail and I've noticed some strange behavior since installing ML.  In Lion, I could click the reply button and the message would automatically be sent from the address the sender had initially sent it to. 
    Now I've noticed since ML, I have to make sure to verify that the SMTP is the same as the account I'm sending from or else it will be sent from another gmail account besides the one the message was originally sent to.  I went into the account settings and made adjustments for every single gmail account and selected the same SMTP server as the selected account and checked the "use only this server box".
    I sent several messages to someone earlier from the default account I normally use to correspond with them (let's call it gmail A) and when that person responded it went to the gmail account that somehow ML now thinks is the default account (gmail B) although I have Mail set up to "send new messages from the account of selected mailbox."
    I noticed before I made the changes that the SMTP for all of the gmail accounts showed "Gmail (Offline)" which made me think that it was defaulting to any gmail account Mail could make a connection to, even though the following was the case:
    I verified that went I sent the message that it was from the exact account I wanted it to be sent from (gmail A) and it is listed in "sent mail" as being sent from the desired account (gmail A) but the response came to gmail B and it showed that I'd originally sent it from gmail B, even though sent shows I sent it from gmail A.
    I find it perplexing that Mail doesn't seem to stick to the same account like before and I do not want people to be receiving mail from me using that one particular address because I infrequently use that account.  I guess the only option is to disable it in Mail so that it's not active and be forced to access it on the Gmail site itself?
    I'm thinking there is some kind of buggy behavior with Mail in ML and wondered if others are seeing something similar?
    Just to make sure that I've made myself clear, this is what I am trying to say:
    In other words, before ML, if I sent a message using Mail to someone from gmail acct X, their response would come back to me at X.  Now after ML, Mail will send gmail from Y or one of the other gmail numerous accounts I have, even though I have X selected in the inbox.  After making adjustments to attempt to "force" gmail X to use SMTP server X, I have noticed that an outgoing message was sent from X but the reply came back to Y.
    I'm just curious if anyone else has managed to fix a similar problem?

    I guess I wasn't hallucinating since an article was just written about this very issue:
    http://www.mcelhearn.com/2012/08/02/bug-in-mountain-lion-mail-sends-replies-usin g-incorrect-accounts/
    [quote]
    I’m on a few e-mail mailing lists, and I’ve noticed that Mail, in OS X 10.8, has been doing something odd. Generally, if you have multiple e-mail accounts, when you reply to a message, your reply uses the same account the message was sent to. But I’ve been finding that Mail does not correctly choose the account, and have seen a number of messages bouncing because the selected account is not a member of the mailing lists.
    [/quote]

  • Bug in firefox using cdata

    I seem to have a bug when attaching an xml file with cdata
    tags in it, works fine in IE but not in any other browser, all i
    get is undefined, yet there is a tutorial on the cs3 dvd showing
    that you can use xml with cdata in it.
    any ideas?

    Hey Daz,
    Is your XML public?
    First suspicions are that there are special characters that
    are not encoded in your CDATA...
    Thanks,
    Don

  • A Bug in iOS7 Using Siri with in Car Bluetooth

    I have a near new Hyundai SanteFe with built in bluetooth.  Under iOs6 it worked fine when listening to CD, Radio or Music from the iPhone. Now, if I use Siri when using Radio or CD it still works fine.  However if I am listening to Music app on the iPhone , using the aux input, when I press to use Siri, either from the bluetooth button in the vehice or from the iphone itself, there is no input from the mic to Siri.  Siri comes up but only tells me what kind of questions I can ask, there is no connection from the bluetooth Mic to Siri itself.
    As it was OK in iOS6, I assume that it is a bug in iOS7.

    Did you ever figure this out?  I have the same problem in an Audi A4

  • Calling a bounded task flow (that uses fragments) from another application

    Hello,
    I'm currently having difficulties calling a task flow located inside another application.
    I have application Console which is my main application in which I would like to run other applications within. Inside this Console I have it divided into splitter windows and inside them I have regions. My goal is to be able to call a task flow from another application inside one of these regions but so far I'm having no luck.
    My first problem occurred when I created a 'local' task flow to make a call to another application's task flow. When I set the properties to the task flow call, it gave me an error that it could not find the .XML file for that task flow when I ran the Console application. I then proceeded to copy that .XML from the remote application into the Console's WEB-INF directory and I seemed to get a bit farther. The error I get now is saying that I cannot run a task-flow that uses fragments. It's essentially trying to run that task flow as an entirely new page instead of inside the region that it's bound to. It's NOT a dynamic region (although that's the end goal here). So I then changed the other application's task flow to simply display an entire page rather than fragments inside a region and voila, it works..... kind of.
    To recap how I was able to call another application's task flow inside the Console:
    - I had to manually copy the task flow xml file into the Console WEB-INF directory
    - I had to change the task flow so that it didn't use fragments
    - I have called the task flow but I lose my console page entirely, no more regions or splitters so I'm back to square one.
    If anybody has any suggestions, hints, tips or anything, send them this way and I will be forever greateful.
    Thanks,
    Mark

    Thanks for your response Frank.
    Unfortunately the problem seems to be greater than that. I've been able to package task-flows into a jar library and tried importing them that way with no luck.
    I'm simple trying to call an external task-flow to run inside a region which is inside a splitter panel that I call my console.
    Any other ideas ?

  • Bugging Array by using COMBO BOX component !!!

    Hi,
    Today, I create a flash with Array. I did use prototype
    method to add one more fantastic function to sort the array
    randomly. But when I include one combo box component with static
    value in to the parent file, I have a big trouble. The flash file
    stop running & give the alert of endless looping. Ah ha, what a
    funny thing is happened out there?
    If you want to produce this bug, please follow me.
    Step1: Create 1 flash movie & name it "test.fla". Copy
    the code below into the first frame.
    Array.prototype.randomSort = function():Array {
    var arr1:Array = this;
    var arr2:Array = new Array();
    var rand:Number;
    while (arr1.length>0) {
    trace(arr1.length);
    rand = Math.floor(Math.random()*arr1.length);
    if (rand == 1 && arr1.length == 1) {
    rand = 0;
    arr2.push(arr1[rand]);
    arr1.splice(rand, 1);
    return arr2;
    Step2: Export the movie by Ctrl+Enter -> we will have
    test.swf huh?
    Step3: Create another flash & name it "main.fla".
    Step4: In main.fla, create an empty movieclip symbol &
    name it loader_mc. Drag it to the stage & five the instance
    name "XXXloader_mc" for example.
    Step5: In main.fla, Drag one combo box component to the stage
    & add some data to the combo
    Step6: In the first frame of main.fla, load the test movie
    into XXXloader_mc. Try this
    XXXloader_mc.loadMovie("test.swf");
    Step7: Export main.fla. Ctrl+Enter again.
    Congratulation, you are in the problem.

    both together caused the problem and i don't see a problem
    with your randomSort() method although destroying the original
    array seems like a bad idea and is one of the 2 reasons for your
    problem:
    one, the combobox is executing your method (and every other
    array prototype method that exists) every time it's clicked. that
    looks like a bug in the combobox component.
    and two, your prototype is causing a problem because it
    destroys the arrays that call your method.

Maybe you are looking for