Skip to content

Commit

Permalink
Reorganization and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shueja committed Jan 10, 2024
1 parent 821ca41 commit 37b8bcd
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 27 deletions.
19 changes: 0 additions & 19 deletions public/fields/2024-field.json

This file was deleted.

Binary file removed public/fields/field24.png
Binary file not shown.
12 changes: 7 additions & 5 deletions src/components/field/svg/FieldOverlayRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { observer } from "mobx-react";
import React, { Component } from "react";
import DocumentManagerContext from "../../../document/DocumentManager";
import OverlayWaypoint from "./OverlayWaypoint";
import FieldImage23 from "./fields/FieldImage23";
import * as d3 from "d3";
import FieldGrid from "./FieldGrid";
import FieldPathLines from "./FieldPathLines";
Expand Down Expand Up @@ -99,8 +98,8 @@ class FieldOverlayRoot extends Component<Props, State> {
this.context.model.uiState.setFieldScalingFactor(factor);
}
render() {
this.canvasHeightMeters = FieldImage23.WIDTH_M + 1;
this.canvasWidthMeters = FieldImage23.LENGTH_M + 1;
this.canvasHeightMeters = FieldImage24.WIDTH_M + 1;
this.canvasWidthMeters = FieldImage24.LENGTH_M + 1;
let layers = this.context.model.uiState.layers;
let constraintSelected = this.context.model.uiState.isConstraintSelected();
return (
Expand Down Expand Up @@ -128,12 +127,15 @@ class FieldOverlayRoot extends Component<Props, State> {
ref={this.frameRef}
id="rootFrame"
>
<FieldAxisLines></FieldAxisLines>
{/* Background */}
{layers[ViewLayers.Field] && (
<FieldImage24 blue={true}></FieldImage24>
<>
{/* <JSONFieldImage24 opacity={10} imageHeightPx={550} imageWidthPx={1220}></JSONFieldImage24> */}
<FieldImage24></FieldImage24>
</>
)}
{layers[ViewLayers.Grid] && <FieldGrid></FieldGrid>}
<FieldAxisLines></FieldAxisLines>
{/* Obstacle and waypoint mouse capture*/}
{layers[ViewLayers.Waypoints] &&
this.context.model.uiState.isNavbarWaypointSelected() && (
Expand Down
10 changes: 10 additions & 0 deletions src/components/field/svg/fields/Field2024.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"game": "Crescendo",
"field-image": "2024-field.png",
"field-corners": {
"top-left": [113, 25],
"bottom-right": [1108, 522]
},
"field-size": [54.27083, 26.9375],
"field-unit": "foot"
}
2 changes: 1 addition & 1 deletion src/components/field/svg/fields/FieldImage24.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from "react";

type Props = { blue: boolean };
type Props = {};

type State = {};

Expand Down
3 changes: 1 addition & 2 deletions src/components/field/svg/fields/JSONFieldImage24.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from "react";
import { FtToM, InToM } from "../../../../util/UnitConversions";
import defaultFieldJSON from "../../../../../public/fields/2024-field.json";
import defaultFieldJSON from "./Field2024.json";

type Props = {
opacity: number;
Expand All @@ -16,7 +16,6 @@ export const LENGTH_M = 16.54175;
export type FieldJSON = {
game: string;
"field-image": string;
"image-size": [number, number];
"field-corners": {
"top-left": [number, number];
"bottom-right": [number, number];
Expand Down

0 comments on commit 37b8bcd

Please sign in to comment.