diff --git a/changelog b/changelog index 4012c65..069a4cc 100644 --- a/changelog +++ b/changelog @@ -112,4 +112,5 @@ v0.2.6: - Fixed scroll to top button being ontop of filters menu - Fixed photo ordering - Fixed automatic updates - - Fixed broken legacy named photos \ No newline at end of file + - Fixed broken legacy named photos + - Fixed photos being loaded with the wrong resolution \ No newline at end of file diff --git a/src-tauri/src/frontend_calls/load_photos.rs b/src-tauri/src/frontend_calls/load_photos.rs index 24544f0..8b8a4ea 100644 --- a/src-tauri/src/frontend_calls/load_photos.rs +++ b/src-tauri/src/frontend_calls/load_photos.rs @@ -11,8 +11,6 @@ struct PhotosLoadedResponse { size: usize, } -// TODO: Multi-layer photos - #[tauri::command] pub fn load_photos(window: tauri::Window, cache: State ) { let base_dir = cache.get("photo-path".into()).unwrap(); diff --git a/src/Components/Managers/PhotoListRenderingManager.tsx b/src/Components/Managers/PhotoListRenderingManager.tsx index db3f7a6..21cdd00 100644 --- a/src/Components/Managers/PhotoListRenderingManager.tsx +++ b/src/Components/Managers/PhotoListRenderingManager.tsx @@ -124,8 +124,8 @@ export class PhotoListRenderingManager{ let photo = (el as PhotoListPhoto).Photo; // === DEBUG === - // ctx.strokeStyle = '#f00'; - // ctx.strokeRect((rowXPos - row.Width / 2) + canvas.width / 2, currentY - scroll, photo.scaledWidth!, row.Height); + ctx.strokeStyle = '#f00'; + ctx.strokeRect((rowXPos - row.Width / 2) + canvas.width / 2, currentY - scroll, photo.scaledWidth!, row.Height); if(!photo.loaded) // If the photo is not loaded, start a new task and load it in that task diff --git a/src/Components/Managers/PhotoManager.tsx b/src/Components/Managers/PhotoManager.tsx index d687596..586cfdd 100644 --- a/src/Components/Managers/PhotoManager.tsx +++ b/src/Components/Managers/PhotoManager.tsx @@ -89,9 +89,10 @@ export class PhotoManager{ }); this.Photos = MergeSort(this.Photos); - console.log(this.Photos); + console.log(this.Photos[0]); console.log(this.Photos.length + ' Photos found.'); + if(this.Photos.length === 0 || photoPaths.length > Vars.MAX_PHOTOS_BULK_LOAD){ console.log('No photos found or over bulk load limit, Skipping loading stage.'); @@ -129,6 +130,8 @@ export class PhotoManager{ photo.metaLoaded = true; photo.onMetaLoaded(); + window.PhotoListRenderingManager.ComputeLayout(); + if(this._amountLoaded === this.Photos.length - 1 && !this.HasFirstLoaded){ this.FilteredPhotos = this.Photos; this.HasFirstLoaded = true; diff --git a/src/Components/PhotoList.tsx b/src/Components/PhotoList.tsx index b8cf20d..b9ffe7b 100644 --- a/src/Components/PhotoList.tsx +++ b/src/Components/PhotoList.tsx @@ -154,7 +154,6 @@ let PhotoList = () => { }) window.PhotoListRenderingManager.SetCanvas(photoContainer!); - window.PhotoListRenderingManager.ComputeLayout(); render(); }); diff --git a/src/Components/PhotoViewer.tsx b/src/Components/PhotoViewer.tsx index 507d96f..b38d0b0 100644 --- a/src/Components/PhotoViewer.tsx +++ b/src/Components/PhotoViewer.tsx @@ -367,6 +367,12 @@ let PhotoViewer = () => { ) } + let toggleLayerManager = () => { + + } + + // TODO: Make layers selectable + return (
viewer = el}>
viewerContextMenu = el}> @@ -442,6 +448,7 @@ let PhotoViewer = () => {
animate(el.currentTarget, { width: '40px', height: '40px', 'margin-left': '15px', 'margin-right': '15px', 'margin-top': '-10px' })} onMouseLeave={( el ) => animate(el.currentTarget, { width: '30px', height: '30px', 'margin-left': '20px', 'margin-right': '20px', 'margin-top': '0px' })} > diff --git a/src/Components/Structs/Photo.ts b/src/Components/Structs/Photo.ts index a2190fd..6940c9b 100644 --- a/src/Components/Structs/Photo.ts +++ b/src/Components/Structs/Photo.ts @@ -75,18 +75,18 @@ export class Photo{ else resSplit = split[3].split('x') - let width = parseInt(resSplit[0]); - let height = parseInt(resSplit[1]); - - if(!isNaN(width) || !isNaN(height)){ - this.width = width; - this.height = height; - - let scale = Vars.PHOTO_HEIGHT / this.height; - - this.scaledWidth = this.width * scale; - this.scaledHeight = Vars.PHOTO_HEIGHT; - } + // let width = parseInt(resSplit[0]); + // let height = parseInt(resSplit[1]); + + // if(!isNaN(width) || !isNaN(height)){ + // this.width = width; + // this.height = height; + + // let scale = Vars.PHOTO_HEIGHT / this.height; + + // this.scaledWidth = this.width * scale; + // this.scaledHeight = Vars.PHOTO_HEIGHT; + // } } loadMeta(){