Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3559518406 for ; Wed, 2 Mar 2016 14:36:28 +0000 (UTC) Received: (qmail 27211 invoked by uid 500); 2 Mar 2016 14:36:27 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 27182 invoked by uid 500); 2 Mar 2016 14:36:27 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 27166 invoked by uid 99); 2 Mar 2016 14:36:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2016 14:36:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 1AE4D1804E3 for ; Wed, 2 Mar 2016 14:36:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.179 X-Spam-Level: ** X-Spam-Status: No, score=2.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4APSfcli2R10 for ; Wed, 2 Mar 2016 14:36:24 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 9B1935F341 for ; Wed, 2 Mar 2016 14:36:23 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id l68so83109251wml.0 for ; Wed, 02 Mar 2016 06:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=zhP0NhgSDxnFrw6L2S5lamQJ7tzJE4Ogs+9N0COSQgg=; b=u6gAeDXU9SlvVsCmms+QL7Cz5xHpvLyH7Pa0ACnYYtkfkyifi9eOMh4BPK/4A8+ZIw J27/ADXCUixjZ0HEJZslzb9Qy47c5Wz32XjFlMMIOLuuSDQqhfNzSf3lFGvtUx2qJ+fC ISEzakxPNpHKUA3wP0k8Uc/GVnDcxBiW3CRMbOwqUEHjXwCqZhsQ2EmGC1Rowri7H33E Ww+/iGywKl6gr7zF1OIZ31TjhBQfxq7d/EtRUABubjEr2/QEX1p9deVGOEgvHqsu69F6 bBZJeW6GFSpGY6PmW/EWyReBPtLpTNPhdkuz5MxHHteIhhQmi63rFwIjE/ISizlV2nxM 8U0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=zhP0NhgSDxnFrw6L2S5lamQJ7tzJE4Ogs+9N0COSQgg=; b=AqNtKIu9hC2EZ4FC0Vjqr8GSKGTqjRuvlXypbqfX9+j2J4hirZlHlrheRzVU3Fc2se 87/zxU7bz7e2sBCBDdWysIU9PaISta44/3LKuRZOmgdQ92oWxm84QXejnVaRt/TbSxJm yoWhTwjG5bQkLlxyRDTe99VXATupQGuU8G5nyTaVyWkms5w2Mrv25yPoxeM3HtFpBdN8 VUpKPL6oDrNZLX8JpZqG7VT7Bto26fyS1NToO233KxBMSd/5JOZWNMXWs1dRS+d/H8Ft mb6+wHvYY/RFDFhPcTCHNNaj4fyKXKd/+I18Tp55HosZd8InrsZI15TesNGhQu+6DZo/ YaCg== X-Gm-Message-State: AD7BkJIvv4I6qxabO8T6edbpbYAbtvHl2t6t9AXizPisR4Kbg1Ziw9A40D7A4Kw9b0Kw6ImZan74lvyLLlnhlQ== MIME-Version: 1.0 X-Received: by 10.28.4.203 with SMTP id 194mr295953wme.12.1456929382525; Wed, 02 Mar 2016 06:36:22 -0800 (PST) Received: by 10.27.135.193 with HTTP; Wed, 2 Mar 2016 06:36:22 -0800 (PST) In-Reply-To: References: <1456577474458-12068.post@n4.nabble.com> <1456672997481-12076.post@n4.nabble.com> Date: Wed, 2 Mar 2016 06:36:22 -0800 Message-ID: Subject: Re: Error #2006: The supplied index is out of bounds From: Clint M To: users@flex.apache.org Content-Type: multipart/alternative; boundary=001a1141e14e4ef4d2052d11ce9a --001a1141e14e4ef4d2052d11ce9a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I agree with Om that we shouldn't be resizing them. If they're outside the bounds because of size it must be an absurdly large text based control and I think an error is appropriate to let the programmer know he's made an error. This control only uses these stageTexts to create bitmaps so it doesn't matter where they are in the global coordinate space. It only matters when a user clicks on the control and puts it in an edit state that the stageText needs to be positioned correctly over the Flex based component. Om, the pattern for this control should be similar to the pattern for the sfly page renderer when we had a single renderer off the edge of the stage that generated bitmaps that we reused. ScrollableStageText is using a StageTextPool and creating one StageText for each flex based ScrollableStageText. This creates a 1 - 1 mapping of StageTexts to ScrollableStageText instances. (i.e. 100 ScrollableStageTexts =3D 100 StageTexts). It then tries to maintain the StageText's position over the ScrollableStageText instance using updateViewport() I think we can get away with 1 or 2 or maybe 3 StageText instances total for any Flex app that uses ScrollableStageText. One for making bitmaps positioned just off the stages viewable area. One for editing that's hidden until a control requests an edit state. Maybe one for focus change, but I'm not sure this is required yet as I'd like to reuse the control used for editing and might actually fix a focusManager based softKeyboard activation/deactivation bug I'm also looking at. In the case of a VGroup with 200 TextInputs that are 20px high and 25px apart (8200 px tall) there would still only be 3 StageText instances. This seems like it would be a better fix for the bug in question. Again I'm happy to make these changes and run them through a QA cycle here on my current contract. I just need a week or so to get to it. On Tue, Mar 1, 2016 at 2:46 PM, OmPrakash Muppirala wrote: > On Tue, Mar 1, 2016 at 1:01 PM, OmPrakash Muppirala > wrote: > > > On Tue, Mar 1, 2016 at 8:33 AM, Alex Harui wrote: > > > >> Hmm. I may still be misunderstanding, but I thought this was a basic > >> clipping issue. So Clint is right about the goal of the math, but I > think > >> it doesn't matter if the StageText is on the visible portion of the > screen > >> or not. For example, a very wide StageText could start offscreen, hav= e > >> some of it on screen and more of it offscreen as long as no part of it > >> goes out past -8192 or +8192. > >> > >> If that's true, then I think the code has to recognize that changing > the x > >> property MOVES the StageText's right side. IMO, you don't want to mov= e > >> the right side, so if you change .x, you have to change .width (but no= t > >> vice-versa). The clipping code should just visit each of the four sid= es > >> to make them fit within the allowed range and make adjustments without > >> moving the opposite side. > >> > >> So, something like: > >> > >> if (x < -8192) { > >> var delta =3D -8192 - x; > >> x +=3D delta; > >> width -=3D delta; > >> } > >> if (x + width > 8192) { > >> var delta =3D x + width - 8192; > >> width -=3D delta; > >> } > >> > >> Of course, I could definitely be wrong... > >> > >> > > The problem is if we change the StageText object's width, it will > > potentially affect the text that is getting rendered. A smaller width > > means that a wrap occurs earlier in the body of text. > > > > That is the crux of the problem. If the x or y of the stagetext is > > outside the allowed bounds, we can always move it without affecting the > > text. When the width or height is outside the bounds (which also cause= s > > the ViewPort rectangle to go outside the allowed bounds) we will have > this > > issue no matter what. > > > > I guess, we just need to throw an error in this case. I dont think it = is > > a common scenario to have such a large TextInput control. > > > > > There's also the case where a combination of x + width causes the viewpor= t > bounds to exceed the 8192 threshold. I am not sure how we would handle > this case. > > > > > Thanks, > > Om > > > > > >> -Alex > >> > >> On 3/1/16, 7:02 AM, "Clint M" wrote: > >> > >> >Well the key is=E2=80=A6 If you think about this in the _global_ (sta= ge) > >> >coordinate > >> >space=E2=80=A6 anything outside the bounds of 0,0,stage.width,stage,h= eight > won't > >> >be > >> >viewable to anyone so it should be safe in all cases to just position > the > >> >StageText outside the viewable stage area and leave it there until so= me > >> >part of it is viewable. > >> > > >> >If you're unable to position the StageText off the stage because it's > too > >> >big. Raise an error about the limits. > >> > > >> >The math for the edge cases is most likely that the StageText Rect is > >> >contained within the Rect that makes up the limits. > >> > > >> >So: > >> >x > -8192 && x + width < 8192 > >> >y > -8192 && y + height < 8192 > >> > > >> >However=E2=80=A6 I feel like the control is misbehaving. > >> >I think one of the goals of this control is to show a proxied bitmap > >> >instead of the actual StageText itself. > >> >So why does it create a StageText at the correct x,y at all? > >> >To generate the bitmap we can just have a single StageText off the ed= ge > >> of > >> >the stage. > >> >And then in the case of edit make a new one and potentially have one > more > >> >for the case of a focus change for a total of 3 instances of StageTex= t > >> >although I think I could get away with just 2 instances it might > actually > >> >solve a keyboard activate/deactivate bug I'm looking at as well. > >> > > >> >I intend to come back to this control to see if I can make it work th= e > >> way > >> >I describe because I've been trying to use it as is for the past few > >> weeks > >> >and failed. > >> > > >> >There's also a bug with focus management and the way scroller's > >> >softKeyboardActivate handler is trying to ensure that the control is = in > >> >the > >> >viewable area before ScrollableStageText calls assignFocus. > >> > > >> > > >> > > >> >On Tue, Mar 1, 2016 at 2:28 AM, OmPrakash Muppirala < > >> bigosmallm@gmail.com> > >> >wrote: > >> > > >> >> Hmm, I'm not sure if there is a good solution for this. Here are t= he > >> >> scenarios which could trigger this behavior: > >> >> > >> >> text=3D"Hello"/> > >> >> text=3D"Hello"/> > >> >> > >> >> > >> >> > >> >> The StageText.viewPort has a hard limit of -8192 to 8191 for its x > and > >> y > >> >> values. > >> >> > >> >> Is there a good way to solve this for for all cases? > >> >> > >> >> Thanks, > >> >> Om > >> >> > >> >> On Tue, Mar 1, 2016 at 12:10 AM, OmPrakash Muppirala > >> >> >> >> > > >> >> wrote: > >> >> > >> >> > >> > >> > > > --001a1141e14e4ef4d2052d11ce9a--