Skip to content

Commit

Permalink
Experimental calculatePointerMeta #423
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Sep 20, 2020
1 parent ecf34ce commit 6bbfed6
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 72 deletions.
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 23, 2019
# Copyright (c) 2017 - 2019 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.0.1699
pkgver=2.4.0.1700
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/alldeps/debian/changelog
@@ -1,5 +1,5 @@
lpub3d (2.4.0.1699) debian; urgency=medium
lpub3d (2.4.0.1700) debian; urgency=medium

* LPub3D version 2.4.0.1.1699_20200920 for Linux
* LPub3D version 2.4.0.1.1700_20200920 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sun, 20 Sep 2020 09:28:42 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sun, 20 Sep 2020 09:29:20 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.0.1699
Version: 2.4.0.1700
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/alldeps/lpub3d.spec
Expand Up @@ -116,7 +116,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.0.1699
Version: 2.4.0.1700
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -728,5 +728,5 @@ update-mime-database /usr/share/mime >/dev/null || true
update-desktop-database || true
%endif

* Sun Sep 20 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1699
* Sun Sep 20 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1700
- LPub3D Linux package (rpm) release
Binary file modified builds/utilities/ci/secure/.secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/utilities/version.info
@@ -1 +1 @@
2 4 0 1 1699 b5c7da4
2 4 0 1 1700 ecf34ce
117 changes: 56 additions & 61 deletions mainApp/dividerpointeritem.cpp
Expand Up @@ -420,69 +420,64 @@ void DividerPointerItem::calculatePointerMeta()
{
calculatePointerMetaLoc();

PointerData pointerData = pointer.pointerMeta.value();
if (segments() == OneSegment) {
if (divider->parentStep->onlyChild()) {
points[Tip] += QPoint(divider->loc[XX],divider->loc[YY]);
} else {
switch (divider->parentRelativeType) {
case StepType:
points[Tip] += QPoint(divider->loc[XX],divider->loc[YY]);
break;
case PageType:
case StepGroupType:
points[Tip] -= QPoint(divider->parentStep->grandparent()->loc[XX],
divider->parentStep->grandparent()->loc[YY]);
points[Tip] -= QPoint(divider->parentStep->loc[XX],
divider->parentStep->loc[YY]);
points[Tip] += QPoint(divider->loc[XX],divider->loc[YY]);
break;
default:
break;
}
}

/*
if (divider->parentStep->onlyChild()) {
points[Tip] += QPoint(divider->loc[XX],divider->loc[YY]);
} else {
switch (divider->parentRelativeType) {
case CsiType:
case PartsListType:
case StepNumberType:
points[Tip] += QPoint(divider->loc[XX],divider->loc[YY]);
break;
case PageType:
case StepGroupType:
points[Tip] -= QPoint(divider->parentStep->grandparent()->loc[XX],
divider->parentStep->grandparent()->loc[YY]);
points[Tip] -= QPoint(divider->parentStep->loc[XX],
divider->parentStep->loc[YY]);
points[Tip] += QPoint(divider->loc[XX],divider->loc[YY]);
break;
default:
break;
}
}
*/

if (divider->placement.value().relativeTo == StepGroupType ||
divider->placement.value().relativeTo == CalloutType) {
points[Tip] -= QPoint(divider->parentStep->loc[XX],
divider->parentStep->loc[YY]);
auto calculateOffset = [this] (SelectedPoint selected, PointerData &pData) {
float pointerData[2];
if (segments() == OneSegment && selected == Tip) {
if (divider->parentStep->onlyChild()) {
points[selected] += QPoint(divider->loc[XX],divider->loc[YY]);
} else {
switch (divider->parentRelativeType) {
case StepType:
points[selected] += QPoint(divider->loc[XX],divider->loc[YY]);
break;
case PageType:
case StepGroupType:
points[selected] -= QPoint(divider->parentStep->grandparent()->loc[XX],
divider->parentStep->grandparent()->loc[YY]);
points[selected] -= QPoint(divider->parentStep->loc[XX],
divider->parentStep->loc[YY]);
points[selected] += QPoint(divider->loc[XX],divider->loc[YY]);
break;
default:
break;
}
}
if (divider->placement.value().relativeTo == StepGroupType ||
divider->placement.value().relativeTo == CalloutType) {
points[selected] -= QPoint(divider->parentStep->loc[XX],
divider->parentStep->loc[YY]);
}
pointerData[XX] = float(points[selected].x() - divider->parentStep->csiItem->loc[XX])/divider->parentStep->csiItem->size[XX];
pointerData[YY] = float(points[selected].y() - divider->parentStep->csiItem->loc[YY])/divider->parentStep->csiItem->size[YY];
} else {
pointerData[XX] = float(points[selected].x());
pointerData[YY] = float(points[selected].y());
}
switch (selected) {
case Tip:
pData.x1 = pointerData[XX];
pData.y1 = pointerData[YY];
break;
case Base:
pData.x2 = pointerData[XX];
pData.y2 = pointerData[YY];
break;
case MidBase:
pData.x3 = pointerData[XX];
pData.y3 = pointerData[YY];
break;
case MidTip:
pData.x4 = pointerData[XX];
pData.y4 = pointerData[YY];
break;
default:
break;
}
};

pointerData.x1 = float(points[Tip].x() - divider->parentStep->csiItem->loc[XX])/divider->parentStep->csiItem->size[XX];
pointerData.y1 = float(points[Tip].y() - divider->parentStep->csiItem->loc[YY])/divider->parentStep->csiItem->size[YY];
} else {
pointerData.x1 = float(points[Tip].x());
pointerData.y1 = float(points[Tip].y());
pointerData.x2 = float(points[Base].x());
pointerData.y2 = float(points[Base].y());
pointerData.x3 = float(points[MidBase].x());
pointerData.y3 = float(points[MidBase].y());
pointerData.x4 = float(points[MidTip].x());
pointerData.y4 = float(points[MidTip].y());
PointerData pointerData = pointer.pointerMeta.value();
for (int i = 0; i < NumPointerGrabbers; i++) {
calculateOffset(SelectedPoint(i),pointerData);
}

pointer.pointerMeta.setValue(
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/README.txt
@@ -1,4 +1,4 @@
LPub3D 2.4.0.1.1699 (20 09 2020 09:28:42)
LPub3D 2.4.0.1.1700 (20 09 2020 09:29:20)

Features, enhancements, fixes and changes
------------
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/RELEASE_NOTES.html
Expand Up @@ -9,7 +9,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1699 (20 09 2020 09:28:42)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1700 (20 09 2020 09:29:20)</h4>
<hr>
<p>
LPub3D Continuous release.<br>
Expand Down
2 changes: 1 addition & 1 deletion mainApp/org.trevorsandy.lpub3d.appdata.xml
Expand Up @@ -68,7 +68,7 @@
<binary>lpub3d24</binary>
​</provides>
<releases>
<release version="2.4.0.1699" date="2020-09-20">
<release version="2.4.0.1700" date="2020-09-20">
<description>
<p>LPub3D Linux AppImage package</p>
</description>
Expand Down

0 comments on commit 6bbfed6

Please sign in to comment.