now using dims from cursor file info to set correct ratios for the partition display independantly of the front end platform

This commit is contained in:
Clément Le Bihan
2023-11-27 23:11:37 +01:00
parent b33ff55167
commit 36041369db
3 changed files with 9 additions and 20 deletions

View File

@@ -3,6 +3,7 @@ import ResponseHandler from './ResponseHandler';
export const SongCursorInfosValidator = yup.object({
pageWidth: yup.number().required(),
pageHeight: yup.number().required(),
cursors: yup
.array()
.of(
@@ -35,6 +36,7 @@ export const SongCursorInfosHandler: ResponseHandler<
validator: SongCursorInfosValidator,
transformer: (songCursorInfos: yup.InferType<typeof SongCursorInfosValidator>) => ({
pageWidth: songCursorInfos.pageWidth,
pageHeight: songCursorInfos.pageHeight,
cursors: songCursorInfos.cursors.map((cursor) => ({
x: cursor.x,
y: cursor.y,
@@ -67,5 +69,6 @@ export interface CursorInfoItem {
export interface SongCursorInfos {
pageWidth: number;
pageHeight: number;
cursors: CursorInfoItem[];
}