diff --git a/sample/about-bezos.md b/sample/about-bezos.md index 9157c61..a2defd5 100644 --- a/sample/about-bezos.md +++ b/sample/about-bezos.md @@ -65,12 +65,18 @@ One Word * Text will go over image * Image will stretch to fill --- -{"layout": "image_left"} +{ +"layout": "image_left", +"image_stretch": false +} # Specific Positions ![image](assets/sample_bg.jpg) -* !(assets/sample_bg.jpg) -* Text will go over image -* Image will stretch to fill +* ![image] before () +* Places in image + cell in layout. +* Can combine with + image_stretch and layout + to place it anywhere. --- # Hot Reload * It watches the file and diff --git a/src/slides_ui.cpp b/src/slides_ui.cpp index a9ec238..f53bec6 100644 --- a/src/slides_ui.cpp +++ b/src/slides_ui.cpp @@ -42,7 +42,8 @@ void Slide::init(lel::Cell& cell, const std::string& layout) { if($config.contains("image")) { std::string image_name = $config["image"]; auto at_cell = $config.contains("image_cell") ? $gui.entity($config["image_cell"]) : content; - $gui.set(at_cell, {image_name}); + bool stretched = $config.contains("image_stretch") ? $config["image_stretch"].get() : true; + $gui.set(at_cell, {image_name, guecs::THEME.PADDING, stretched}); } $gui.init();