C2LC-372: Scene dimensions should support min/max pairs instead of width/height.

Metadata

Source
C2LC-372
Type
Bug
Priority
N/A
Status
Done
Resolution
N/A
Assignee
N/A
Reporter
Created
2021-04-28T10:17:07.530-0400
Updated
2021-05-06T15:36:24.840-0400
Versions
N/A
Fixed Versions
  1. Coding Env 0.8
Component
  1. Coding Environment

Description

In the discussion on an earlier pull, we discussed refactoring the scene dimension constructor to accept a minimum column (minX) and row (minY):

In the new coordinate system, the SceneDimensions constructor should really now be:

constructor(minX: number, maxX: number, minY: number, maxY: number)

So we can construct with:

new SceneDimensions(1, 26, 1, 16);

But as I mentioned above, it may be too risky to rework at this stage.

This impacts the panning logic as described here:

We'd want a calculation like:

const panningLevel = ((characterState.xPos - minX) / (maxX - minX)) * 2 - 1;

Where minX and maxX are from the SceneDimensions. Unfortunately, right now SceneDimensions will not give us the right min X and max X. It may be too risky to rework SceneDimensions at this point in the 0.7 timeline. I have another thought on panning, which I will leave as a separate comment.

There are also implications for the scene panning, headers, et cetera.