Skip to content
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

Frame size is wrong #29

Closed
dkrasner opened this issue Sep 14, 2022 · 5 comments
Closed

Frame size is wrong #29

dkrasner opened this issue Sep 14, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dkrasner
Copy link
Collaborator

Frame(0, 100).size = Point(100, 100) where its actual size is 101x101

This happens due to the classic errors that arise when thinking about 0 indexed vs 1 indexed arrays

I think this should be handled together with #22

@dkrasner dkrasner added the bug Something isn't working label Sep 14, 2022
@dkrasner
Copy link
Collaborator Author

There are other lurking issues and this is going to screw many things up in the future:

for example:

const array1 = [
    [1, 2, 3],
    [4, 5, 6]
]
const s = new Sheet([0, 0], [0, 0)])
s.dataFrame.loadFromArray(array1);
s.size // (2, 1) as expected
s.corner.x // 2 as expected
s.corner.y  // 1 as expected

const array2 = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]
s.dataFrame.loadFromArray(array1);

s.size // (2, 3) wtf!
s.corner.x // 2 as expected
s.corner.y  // 3 wtf!

the point (2,3) is not even in the sheet, and it's corner should be (2x2) - this. is pretty messed up

@darth-cheney
Copy link
Owner

What is Sheet here -- an ap-sheet or a Worksheet or what?

@dkrasner
Copy link
Collaborator Author

dkrasner commented Nov 1, 2022

ap-sheet

@darth-cheney
Copy link
Owner

ap-sheets -- meaning the actual element -- do not have a size method, so I'm not sure what the example code is trying to do. Do you mean to get the size of the DataFrame?

@dkrasner
Copy link
Collaborator Author

dkrasner commented Nov 1, 2022

s = ap-sheet

everything above refers to the data frame ie s.dataFrame (there is a typo there, should be s.dataFrame for everything)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants