X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=gH5+sTfr9f9He3KzgcRRy0PpnFKzyb8Qkl1bXFwUbKg=; b=mCW0CjVkoXq0gBuXYOpsSoIcz4XESHD2kMUWcJnxadPjHPOxAXS6Sbyf9mHYoeqgBr 7p53B2185ihknVzd7rqKgrRAAG/OObWcqInr8/La8NkZKCTlzf16xYLw3Nt+5tGDIBzL 98DaTw30HVwHCWqNAffthcVL625L/6RETF9SZuff2bqp3YL8Gaxx0T5F+CdM8TLciaeU qnTQ7yj4ZjDj/h/wqtZm5dYQu65aTQJY5SgrJFXBWVa+25/rJBd0YB1lh2C9Umq62lSx BY6FPF/RtoSFHcS1mrz6cXlHWQ//t6a3oioVOwCRcz9Hwwof6R17BcGK+mFx9g9zuWYs XR2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=gH5+sTfr9f9He3KzgcRRy0PpnFKzyb8Qkl1bXFwUbKg=; b=NV2W51rX9bqlPBg/1MVkXrrr6Sxt1Nl8Gp+wvSpDeNqfCzBj0on8PnASGnaGeQmEp+ 6d5zrvikpUSJlBQC2DCYhrr7+S0hGzqZy5nrT225Ee13WdufAeFedo0zqfmCJ8Ee3hhR Lp2/YGzUN+IgJjz5KwP7F321rYLBV8tXqP1J5O/1kCrGZPjdV6SUTRoHt2zEl8MNPaYd /SavJ68iuQLBcuLn7EUvZVpGIwbONo4w8dH0Vfr/w2ldQy3VKMXvhuzaOf6LYOFnupiu knEwV23tLIxuFGC/zPGxiuhqkU2fPUmI7sZ3LWYl4eku3k8zi2ztMW4i8Ub/gV6xwxy0 Z7cg== X-Gm-Message-State: AMke39mECstCSxMzif1XEOwkgC2pvilRlUD+krF8QkvE7mMRufrRYU+WpLH5lE6pAMOncLm6f9PcitQHIiBjzw== X-Received: by 10.223.160.243 with SMTP id n48mr17518309wrn.198.1488833711445; Mon, 06 Mar 2017 12:55:11 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20170306212421.a658cb36967460efbe4ba474@gmail.com> References: <20170306212421 DOT a658cb36967460efbe4ba474 AT gmail DOT com> From: "Luis de Arquer (ldearquer AT gmail DOT com) [via geda-user AT delorie DOT com]" Date: Mon, 6 Mar 2017 21:55:10 +0100 Message-ID: Subject: Re: [geda-user] Rubberband move keeping lines direction To: geda-user AT delorie DOT com Content-Type: multipart/mixed; boundary=94eb2c1848748050a1054a161cc6 Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --94eb2c1848748050a1054a161cc6 Content-Type: text/plain; charset=UTF-8 Actually, I sort of implemented it, but I forgot to add the new files to the patch I sent! This time, I am attaching the full patch. 2017-03-06 21:24 GMT+01:00, Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com) [via geda-user AT delorie DOT com] : > I you remember original position line should be elongenated until it hit the > moved line. You need to calculate the intersection point, it is a good idea > to remember original point during move and if workin 45 or 90 degree angles > on a grid rounding errors will probably not be a problem, I think anyway. > It's good you say that as that's exactly what I did! The movement vector goes from line mid point to neighbour lines' intersection. Have a look at FitCrosshairIntoGrid( ). But actually I am not fitting to the grid, and I gave up on 45/90 grid alignments; that's why I moved to floating point, and made it generic to any angle, which seems to work fine. Anyway, it should be enhanced to grid-align on 45/90 as you say. Maybe, if you could try the patch, you could let me know if it works as you expect I am trying to understand better how the Undo thing works, to complete the implementation. Luis --94eb2c1848748050a1054a161cc6 Content-Type: text/x-patch; charset=UTF-8; name="rubberband_keep_direction.patch" Content-Disposition: attachment; filename="rubberband_keep_direction.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 ZGlmZ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HlPYmplY3QgKGhpZEdDIGdjKQogCSAgICAg IHBvaW50MSA9ICZwdHItPkxpbmUtPlBvaW50MTsKIAkgICAgICBwb2ludDIgPSAmcHRyLT5MaW5l LT5Qb2ludDI7CiAJICAgIH0KLQkgIFhPUkRyYXdBdHRhY2hlZExpbmUgKGdjLCBwb2ludDEtPlgs IHBvaW50MS0+WSwKLQkgICAgICAgICAgICAgICAgICAgICAgIHBvaW50Mi0+WCArIGR4LCBwb2lu dDItPlkgKyBkeSwKLQkgICAgICAgICAgICAgICAgICAgICAgIHB0ci0+TGluZS0+VGhpY2tuZXNz KTsKKwkgICAgaWYgKHB0ci0+RFggPT0gLTEpCisgICAgICB7CisJICAgICAgWE9SRHJhd0F0dGFj aGVkTGluZSAoZ2MsIHBvaW50MS0+WCwgcG9pbnQxLT5ZLAorCSAgICAgICAgICAgICAgICAgICAg ICAgICAgICBwb2ludDItPlggKyBkeCwgcG9pbnQyLT5ZICsgZHksCisJICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHB0ci0+TGluZS0+VGhpY2tuZXNzKTsKKwkgICAgfQorCSAgICBlbHNlCisJ ICAgIHsKKwkgICAgICBYT1JEcmF3QXR0YWNoZWRMaW5lIChnYywgcG9pbnQxLT5YLCBwb2ludDEt PlksCisJICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50Mi0+WCArIHB0ci0+RFgsIHBv aW50Mi0+WSArIHB0ci0+RFksCisJICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ci0+TGlu ZS0+VGhpY2tuZXNzKTsKKwkgICAgfQogCX0KICAgICAgIGVsc2UgaWYgKHB0ci0+TW92ZWRQb2lu dCA9PSAmcHRyLT5MaW5lLT5Qb2ludDEpCiAJWE9SRHJhd0F0dGFjaGVkTGluZSAoZ2MsCkBAIC0x MDIxLDYgKzEwNDIsOTIgQEAgRml0Q3Jvc3NoYWlySW50b0dyaWQgKENvb3JkIFgsIENvb3JkIFkp CiAJICBlbHNlCiAJICAgIG5lYX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5lLT5Qb2ludDEuWCkgLyAyLjA7CisgICAgICAgICAgCWZtaWQueSA9ICgo ZG91YmxlKWxpbmUtPlBvaW50Mi5ZICsgbGluZS0+UG9pbnQxLlkpIC8gMi4wOworICAgICAgICAg IAlmbW92ZS54ID0gZmludGVyc2VjdGlvbi54IC0gZm1pZC54OworICAgICAgICAgIAlmbW92ZS55 ID0gZmludGVyc2VjdGlvbi55IC0gZm1pZC55OworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgLyogTm8gaW50ZXJzZWN0aW9uLiBSdWJiZXJiYW5k IGxpbmVzIGFyZSBwYXJhbGxlbCAqLworICAgICAgICAgICAgZm1vdmUueCA9IGZydWIxLmRpcmVj dGlvbi54OworICAgICAgICAgICAgZm1vdmUueSA9IGZydWIxLmRpcmVjdGlvbi55OworICAgICAg ICAgIH0gICAgICAgCQorICAgICAgICAJICAgICAgICAJCisgICAgICAgIAlpZiAoIWZ2ZWN0b3Jf aXNfbnVsbChmbW92ZSkpCisgICAgICAgIAl7CisgICAgICAgICAgICBmdmVjdG9yX25vcm1hbGl6 ZSgmZm1vdmUpOworCisgICAgICAgICAgICAvKiBDdXJzb3IgZGVsdGEgdmVjdG9yICovCisgICAg ICAgICAgICBmdmVjdG9yIGZjdXJzb3JfZGVsdGE7CisgICAgICAgICAgICBmY3Vyc29yX2RlbHRh LnggPSBDcm9zc2hhaXIuWCAtIE1hcmtlZC5YOworICAgICAgICAgICAgZmN1cnNvcl9kZWx0YS55 ID0gQ3Jvc3NoYWlyLlkgLSBNYXJrZWQuWTsKKworICAgICAgICAgICAgLyogQ3Vyc29yIGRlbHRh IHByb2plY3Rpb24gb24gbW92ZW1lbnQgZGlyZWN0aW9uICovCisgICAgICAgICAgICBkb3VibGUg YW1vdW50X21vdmVkID0gZnZlY3Rvcl9kb3QoZm1vdmUsIGZjdXJzb3JfZGVsdGEpOworCisgICAg ICAgICAgICAvKiBTY2FsZSBmbW92ZSBieSBjYWxjdWxhdGVkIGFtb3VudCAqLworICAgICAgICAg ICAgZnZlY3RvciBmbW92ZV90b3RhbDsKKyAgICAgICAgICAgIGZtb3ZlX3RvdGFsLnggPSBmbW92 ZS54ICogYW1vdW50X21vdmVkOworICAgICAgICAgICAgZm1vdmVfdG90YWwueSA9IGZtb3ZlLnkg KiBhbW91bnRfbW92ZWQ7CisKKyAgICAgICAgICAgIC8qIFVwZGF0ZSB2YWx1ZXMgZm9yIG5lYXJl c3RfZ3JpZCBhbmQgUnViYmVyYmFuZCBsaW5lcyAqLworICAgICAgICAgICAgbmVhcmVzdF9ncmlk X3ggPSBNYXJrZWQuWCArIGZtb3ZlX3RvdGFsLng7CisgICAgICAgICAgICBuZWFyZXN0X2dyaWRf eSA9IE1hcmtlZC5ZICsgZm1vdmVfdG90YWwueTsKKworICAgICAgICAgICAgLyogTW92ZSBydWJi ZXJiYW5kOiBmbW92ZV90b3RhbMK3bm9ybWFsID0gZm1vdmVfcnViYmVyYmFuZMK3bm9ybWFsCisg ICAgICAgICAgICAgKiB3aGVyZSBub3JtYWwgaXMgdGhlIG1vdmluZyBsaW5lIG5vcm1hbAorICAg ICAgICAgICAgICovCisgICAgICAgICAgICBmdmVjdG9yIGZub3JtYWw7CisgICAgICAgICAgICBm bm9ybWFsLnggPSBmbWFpbi5kaXJlY3Rpb24ueTsKKyAgICAgICAgICAgIGZub3JtYWwueSA9IC1m bWFpbi5kaXJlY3Rpb24ueDsKKyAgICAgICAgICAgIGlmIChmdmVjdG9yX2RvdChmbm9ybWFsLCBm bW92ZSkgPCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmbm9ybWFsLnggPSAtZm5v cm1hbC54OworICAgICAgICAgICAgICBmbm9ybWFsLnkgPSAtZm5vcm1hbC55OworICAgICAgICAg ICAgfQorICAgICAgICAgICAgZG91YmxlIHJ1YjFfbW92ZSA9IGFtb3VudF9tb3ZlZCAqIGZ2ZWN0 b3JfZG90KGZtb3ZlLCBmbm9ybWFs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vcl9pc19udWxsIChmdmVjdG9y IHYpCit7CisJcmV0dXJuIGZhYnModi54KSA8IE1JTl9DT01QT05FTlQgJiYgZmFicyh2LnkpIDwg TUlOX0NPTVBPTkVOVDsKK30KKworZG91YmxlIGZ2ZWN0b3JfZG90IChmdmVjdG9yIHYxLCBmdmVj dG9yIHYyKQoreworCXJldHVybiB2MS54ICogdjIueCArIHYxLnkgKiB2Mi55OworfQorCisKK3Zv aWQgZnZlY3Rvcl9ub3JtYWxpemUgKGZ2ZWN0b3IgKnYpCit7CisJZG91YmxlIG1vZHVsZSA9IHNx cnQodi0+eCAqIHYtPnggKyB2LT55ICogdi0+eSk7CisJCisJdi0+eCAvPSBtb2R1bGU7CisJdi0+ eSAvPSBtb2R1bGU7Cit9CisKK2ludCBmbGluZV9pc192YWxpZChmbGluZSBsKQoreworCXJldHVy biAhZnZlY3Rvcl9pc19udWxsKGwuZGlyZWN0aW9uKTsKK30KKworZmxpbmUgZmxpbmVfY3JlYXRl KExpbmVUeXBlICpsaW5lKQoreworCWZsaW5lIHJldDsKKwkKKwlyZXQucG9pbnQueCA9IGxpbmUt PlBvaW50MS5YOworCXJldC5wb2ludC55ID0gbGluZS0+UG9pbnQxLlk7CisJcmV0LmRpcmVjdGlv bi54ID0gbGluZS0+UG9pbnQyLlggLSBsaW5lLT5Qb2ludDEuWDsKKwlyZXQuZGlyZWN0aW9uLnkg PSBsaW5lLT5Qb2ludDIuWSAtIGxpbmUtPlBvaW50MS5ZOworCQorCWlmICghZnZlY3Rvcl9pc19u dWxsIChyZXQuZGlyZWN0aW9uKSkKKwkJZnZlY3Rvcl9ub3JtYWxpemUoICZyZXQuZGlyZWN0aW9u ICk7CisJCisJcmV0dXJuIHJldDsKK30KKworCitmbGluZSBmbGluZV9jcmVhdGVfZnJvbV9wb2lu dHMoUG9pbnRUeXBlICpiYXNlX3BvaW50LCBQb2ludFR5cGUgKm90aGVyX3BvaW50KQoreworCWZs aW5lIHJldDsKKwkKKwlyZXQucG9pbn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uIik7CisgICAg ICAgICAgICBBZGRPYmplY3RUb01vdmVVbmRvTGlzdCAoTElORVBPSU5UX1RZUEUsCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ci0+TGF5ZXIsIHB0ci0+TGluZSwKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyLT5Nb3ZlZFBvaW50LCBEWCwgRFkpOwor ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgcHJp bnRmKCJNb3ZlIGN1c3RvbVxuIik7CisgICAgICAgICAgICBBZGRPYmplY3RUb01vdmVVbmRvTGlz dCAoTElORVBPSU5UX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0 ci0+TGF5ZXIsIHB0ci0+TGluZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cHRyLT5Nb3ZlZFBvaW50LCBwdHItPkRYLCBwdHItPkRZKTsKKyAgICAgICAgICAgIERlbHRhWCA9 IHB0ci0+RFg7CisgICAgICAgICAgICBEZWx0YVkgPSBwdHItPkRZOworICAgICAgICAgIH0KICAg ICAgICAgICBNb3ZlTGluZVBvaW50IChwdHItPkxheWVyLCBwdHItPkxpbmUsIHB0ci0+TW92ZWRQ b2ludCk7CisgICAgICAgICAgLyogUmVzdG9yZSBEZWx0YSAqLworICAgICAgICAgIERlbHRhWCA9 IERYOworICAgICAgICAgIERlbHRhWSA9IERZOwogICAgICAgICB9CiAgICAgICBDcm9zc2hhaXIu QXR0YWNoZWRPYmplY3QuUnViYmVyYmFuZE4tLTsKICAgICAgIHB0cisrOwo= --94eb2c1848748050a1054a161cc6--