Comments (2)
Here's how the attached example looks:
gridbug2.mp4
from egui_commonmark.
Repo without CommonMarkViewer
use eframe::egui;
fn main() {
let native_options = eframe::NativeOptions::default();
eframe::run_native(
"Commonmark bug",
native_options,
Box::new(|_cc| Box::new(App::default())),
)
.expect("failed to run app");
}
#[derive(Default)]
struct App {
content: String,
}
impl eframe::App for App {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
egui::Grid::new("my_grid")
.num_columns(2)
.striped(true)
.show(ui, |ui| {
ui.label("row 1, col 1");
ui.label("row 1, col 2");
ui.end_row();
ui.label("row 2, col 1");
let layout =
egui::Layout::left_to_right(egui::Align::BOTTOM).with_main_wrap(true);
ui.allocate_ui_with_layout(egui::vec2(200.0, 0.0), layout, |ui| {
ui.label(&self.content);
});
});
});
self.content += "a";
ctx.request_repaint();
}
with_main_wrap
is guilty. My naive guess is that the layout grows downwards, but the grid tries to center it, so it allocates space on both sides which is what causes the growth. I have tried different Align options but it does not appear to change anything.
I don't know whether this is a case of using egui wrong or if it's a bug in Grid.
from egui_commonmark.
Related Issues (20)
- Make types implement Debug
- Add a "copy content" button to code blocks
- Title to body vertical space missing when an image precedes the title
- Copy button doesn't work on Safari HOT 2
- Is there some sort of a solution to disparity in image paths between WASM and native targets? HOT 4
- LaTeX support HOT 9
- How to change the code block font size? HOT 4
- Consider comrak as an alternative parser
- Place footnotes at the end
- Table creates extra columns for items that belong in the same column HOT 1
- Styling in markdown tables is broken HOT 4
- Feature request: Support for mutable checkboxes HOT 8
- Better support for lists
- Incorrect newline for code block in lists
- Wrong vertical spacing around bullet lists HOT 2
- Compile time parsing
- Add FAQ, and FAQ item about enabling urls on hover in hyperlinks
- `CommonMarkViewer` adds empty veritcal space around it
- What exactly is the `CommonMarkViewer::id` used for? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egui_commonmark.