aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-08-01 09:39:38 -0400
committerbobzel <zzzman@gmail.com>2020-08-01 09:39:38 -0400
commitb33e31e369aef6e0675219c96ba4b8a058a69b0c (patch)
treeb71dca5ca18c137e0a4a3d9edb38f97e4ee3dc94 /src/client/views/collections/collectionFreeForm/PropertiesView.tsx
parente084dfdc8da4cbf2ad7039111d9118a330259a33 (diff)
fixed warnings
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/PropertiesView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.tsx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
index a3c9516e1..ca81bf131 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
@@ -399,11 +399,11 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
if (ink) {
const newPoints: { X: number, Y: number }[] = [];
- for (var i = 0; i < ink.length; i++) {
- const newX = Math.cos(angle) * (ink[i].X - _centerPoints[index].X) - Math.sin(angle) * (ink[i].Y - _centerPoints[index].Y) + _centerPoints[index].X;
- const newY = Math.sin(angle) * (ink[i].X - _centerPoints[index].X) + Math.cos(angle) * (ink[i].Y - _centerPoints[index].Y) + _centerPoints[index].Y;
+ ink.forEach(i => {
+ const newX = Math.cos(angle) * (i.X - _centerPoints[index].X) - Math.sin(angle) * (i.Y - _centerPoints[index].Y) + _centerPoints[index].X;
+ const newY = Math.sin(angle) * (i.X - _centerPoints[index].X) + Math.cos(angle) * (i.Y - _centerPoints[index].Y) + _centerPoints[index].Y;
newPoints.push({ X: newX, Y: newY });
- }
+ });
doc.data = new InkField(newPoints);
const xs = newPoints.map(p => p.X);
const ys = newPoints.map(p => p.Y);
@@ -534,11 +534,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
getField(key: string) {
- //if (this.selectedDoc) {
- return Field.toString(this.selectedDoc[key] as Field);
- // } else {
- // return undefined as Opt<string>;
- // }
+ return Field.toString(this.selectedDoc?.[key] as Field);
}
@computed get shapeXps() { return this.getField("x"); }