Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 03DAA200498 for ; Tue, 29 Aug 2017 22:28:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0257B16781E; Tue, 29 Aug 2017 20:28:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 20DA516781A for ; Tue, 29 Aug 2017 22:28:54 +0200 (CEST) Received: (qmail 41335 invoked by uid 500); 29 Aug 2017 20:28:54 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 41318 invoked by uid 99); 29 Aug 2017 20:28:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Aug 2017 20:28:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 34032CD375 for ; Tue, 29 Aug 2017 20:28:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.878 X-Spam-Level: * X-Spam-Status: No, score=1.878 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=adobe.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id z1oJHpRidwC0 for ; Tue, 29 Aug 2017 20:28:51 +0000 (UTC) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0063.outbound.protection.outlook.com [104.47.41.63]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1C8CD5FC5D for ; Tue, 29 Aug 2017 20:28:50 +0000 (UTC) Received: from BN6PR02MB2804.namprd02.prod.outlook.com (10.175.96.15) by BN6PR02MB3140.namprd02.prod.outlook.com (10.161.153.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Tue, 29 Aug 2017 20:28:42 +0000 Received: from BN6PR02MB2804.namprd02.prod.outlook.com ([10.175.96.15]) by BN6PR02MB2804.namprd02.prod.outlook.com ([10.175.96.15]) with mapi id 15.01.1385.014; Tue, 29 Aug 2017 20:28:42 +0000 From: Peter Ent To: "dev@flex.apache.org" Subject: [FlexJS] Finding (x,y) position Thread-Topic: [FlexJS] Finding (x,y) position Thread-Index: AQHTIQVnJORdNJ67/kavlLRBStwyFw== Date: Tue, 29 Aug 2017 20:28:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.7.2.170228 authentication-results: spf=none (sender IP is ) smtp.mailfrom=pent@adobe.com; x-originating-ip: [73.207.33.254] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR02MB3140;6:wyCIhP1EDFYVqxNYH+Rxs7/lTfyDLdpYxSWOSlUOt+J4ingDInA5AezCTn9EUB2JZ7nwioSmN2v5w47MQ0A5XqnOxv2MVOz//Roe6Z5pShcHe6K4yPe33689YWRT+y7cecZ7tJUBWKjDVnnAut2GOkcezmScbGH84jJKNYhx5ppHz7Cn1Vy34L0TDUiP1NBc8rm6V/R1IM1mkTGwzgv51AedpEQhd/1XzrITTJvsSTMHSJTYK9t+s/8tQOszBoRICLiYZ3+fgnD88k4CviN9DKatQdgn2UYVNldk23qu+s7VoicJQjSzFebNX/QOxOx/mbTbg1jvMxkwtGxKyClNeg==;5:iAkW1TL/FrlhkvbzuGpdXLkIFlvhp1jXQfxesgD/aB7lnp4jwIHDtgs4iK9yVuVqW0CiCXRW6u4z8Q8m+HABhBw2M0WyHcB1FbTHuf1qPblpPSpjJeOV9JUOnMFURS1TK+/1xTJcBB2J/wutPT2qVQ==;24:BVeCUhH3a12BPp8n+6LXGjI7NfjQy0PaUShqYBgzJP4PLHA4FlpjIqpoSo2plVWU0ArvzYRBy+jdj6sll1wAvOeKKnTxstm3dOsSLmcJ+Os=;7:193ewYmAiuAcZdbrKh2gNRpH1Kw2kM4Osfa36eJzVgBffTPLTAVUWWn+SWVH41YW/vK8ZHPn3qk0nnsaomfwLWIwCI5R4N8Yn5cVWUYGZ6LdCKictbDBKj5QhF8k3LZ2Myu5Qm+fiupD5ZQZ4k4gKKAwoIQ+2iz4vagiih/YBgQnXtFrsaxOKxD3A3ZCcHL0WyAyzGsyvEpGk+Kl1UoSZQQJVqX5WedRc9QnNy/T98c= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 3810b20b-de4f-472d-184f-08d4ef1c8a37 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN6PR02MB3140; x-ms-traffictypediagnostic: BN6PR02MB3140: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR02MB3140;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR02MB3140; x-forefront-prvs: 0414DF926F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(189002)(199003)(2906002)(110136004)(478600001)(99286003)(53936002)(14454004)(5660300001)(54896002)(5640700003)(6512007)(86362001)(2900100001)(50986999)(189998001)(54356999)(101416001)(25786009)(6436002)(2501003)(81156014)(81166006)(83506001)(1730700003)(102836003)(6116002)(3846002)(8676002)(2351001)(6916009)(36756003)(105586002)(6486002)(77096006)(66066001)(6506006)(7736002)(97736004)(8936002)(3660700001)(68736007)(10090500001)(106356001)(3280700002)(4001350100001)(142933001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR02MB3140;H:BN6PR02MB2804.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: adobe.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_D5CB46B62680Epentadobecom_" MIME-Version: 1.0 X-OriginatorOrg: adobe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2017 20:28:42.0728 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fa7b1b5a-7b34-4387-94ae-d2c178decee1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3140 archived-at: Tue, 29 Aug 2017 20:28:56 -0000 --_000_D5CB46B62680Epentadobecom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, While working on drag-and-drop, I've made an "interesting" discovery having= to do with the HTML-side's x and y getter functions. Let's say you have a nesting of
s:
=85
=85
(this structure is similar to what is generated for DataGrid). If you attempt to get the y location of "first" itemRenderer, you will get = 30 back as the answer. That happens because the y getter first looks to see= if the object has a "top" style value and, finding none, returns its offse= tTop. In this case, offsetTop is 30 and offsetParent is "outer". If you get= the y value of "inner" you will also get 30 as the answer for the same rea= son. If each of the
s had position:relative (or absolute), then offsetTop w= ould be as you would expect with each offsetParent being the
above it= . Our layout functions (and x and y setters) do not normally set the position= style on element. I removed this a good while ago. Now I am trying to plac= e a drop target indicator and to do that I need accurate (x,y) locations. I have a couple of solutions: 1. For any element, look at its getBoundingClientRect and compare with i= ts elementParent.getBoundingClientRect. The difference between then gives t= he child's position relative to the parent. This seems reliable. 2. Attempt to divine a child's position using the offset information. I = can't make this work. 3. Modify the layouts to check the contentView's value of position and i= f not set already, set it to "relative". This makes the x and y getters ret= urn the right thing but may have unintended consequences. Any advice from seasoned JavaScript developers is greatly appreciated! Thanks, Peter --_000_D5CB46B62680Epentadobecom_--