-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change step grid #181
base: main
Are you sure you want to change the base?
Change step grid #181
Changes from 2 commits
e790bd0
34eadc5
57ba5a2
cada7de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,21 +124,38 @@ export default Vue.extend({ | |
this.$store.getters.getFrontHashOffsetY | ||
); | ||
}, | ||
// fourStepGridOffsetsX(): number[] { | ||
// const offset: number = this.$store.state.yardlines ? 8 : 4; | ||
// const retVal: number[] = [4, 8, this.fieldWidth - 8, this.fieldWidth - 4]; | ||
// for ( | ||
// let offsetX = 12; | ||
// offsetX <= this.fieldWidth - 12; | ||
// offsetX += offset | ||
// ) { | ||
// retVal.push(offsetX); | ||
// } | ||
// return retVal; | ||
// }, | ||
fourStepGridOffsetsX(): number[] { | ||
const offset: number = this.$store.state.yardlines ? 8 : 4; | ||
const retVal: number[] = [4, 8, this.fieldWidth - 8, this.fieldWidth - 4]; | ||
const retVal: number[] = []; | ||
const gridSize: number = this.$store.state.gridSize; | ||
for ( | ||
let offsetX = 12; | ||
offsetX <= this.fieldWidth - 12; | ||
offsetX += offset | ||
let offsetX = gridSize * 2; | ||
offsetX < this.fieldWidth; | ||
offsetX += gridSize * 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't have to multiply by 2 here, the X/Y scale should be 1 spacing unit to 1 step. Notice in the screenshots that the 4 step grid is actually an 8 step grid (there should be a vertical line in between each line yard, since each line yard is 8 steps between each other). |
||
) { | ||
retVal.push(offsetX); | ||
} | ||
return retVal; | ||
}, | ||
fourStepGridOffsetsY(): number[] { | ||
const retVal: number[] = []; | ||
for (let offsetY = 4; offsetY < this.fieldHeight; offsetY += 4) { | ||
const gridSize: number = this.$store.state.gridSize; | ||
for ( | ||
let offsetY = gridSize * 2; | ||
offsetY < this.fieldHeight; | ||
offsetY += gridSize * 2 | ||
) { | ||
retVal.push(offsetY); | ||
} | ||
return retVal; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,27 @@ | |
</b-checkbox> | ||
</b-navbar-item> | ||
</b-navbar-dropdown> | ||
|
||
<b-navbar-dropdown label="Grid" data-test="menu-top--grid"> | ||
<b-navbar-item | ||
data-test="menu-top--grid-one" | ||
@click="changeStepGrid(1)" | ||
> | ||
One Step | ||
</b-navbar-item> | ||
<b-navbar-item | ||
data-test="menu-top--grid-two" | ||
@click="changeStepGrid(2)" | ||
> | ||
Two Step | ||
</b-navbar-item> | ||
<b-navbar-item | ||
data-test="menu-top--grid-four" | ||
@click="changeStepGrid(4)" | ||
> | ||
Four Step | ||
</b-navbar-item> | ||
</b-navbar-dropdown> | ||
Comment on lines
+82
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works okay, but I don't think this should be it's own top navbar item. We should reserve creating a new dropdown at the top level for new categories (For example, see the top menu of any program you use, "File", "Edit", "View", "Help", etc.) Let's consider other options... How about the bottom menu next to all the tool icons? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</template> | ||
</b-navbar> | ||
|
||
|
@@ -161,6 +182,10 @@ export default Vue.extend({ | |
newShow(): void { | ||
this.$store.commit(Mutations.SET_SHOW, new InitialShowState()); | ||
}, | ||
|
||
changeStepGrid(size: number): void { | ||
this.$store.commit(Mutations.SET_GRID_SIZE, size); | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,6 +40,8 @@ export class CalChartState extends Serializable<CalChartState> { | |||||
|
||||||
showDotLabels = true; | ||||||
|
||||||
gridSize = 2; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once the x2 comment is resolved in
Suggested change
|
||||||
|
||||||
grapherSvgPanZoom?: SvgPanZoom.Instance; | ||||||
|
||||||
invertedCTMMatrix?: DOMMatrix; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this and
fourStepGridOffsetsY
to something more generic