From d8628b2a1728a2e5cc4c2da6bccb66d0bbcf80c2 Mon Sep 17 00:00:00 2001 From: Bart Kummel Date: Wed, 19 Jun 2024 19:28:10 +0000 Subject: [PATCH 1/3] Allow to scale down below original recipe, and format as fractions, just like ingredients --- .../Domain/Recipe/RecipeScaleEditButton.vue | 7 ++-- .../use-extract-recipe-yield.test.ts | 24 ++++++------- .../recipe-page/use-extract-recipe-yield.ts | 34 +++++++------------ .../recipes/use-recipe-ingredients.test.ts | 3 +- .../recipes/use-recipe-ingredients.ts | 27 ++++++++++----- 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue b/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue index ef948b68013..9567f4aa14d 100644 --- a/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue +++ b/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue @@ -5,7 +5,7 @@ @@ -47,8 +47,8 @@ event: 'increment', }, ]" - @decrement="scale > 1 ? scale-- : null" - @increment="scale++" + @decrement="scale > 1 ? scale-- : (scale > 0.12 ? scale = scale / 2 : null)" + @increment="scale > 1 ? scale++ : scale = scale * 2" /> @@ -56,6 +56,7 @@