Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6a6481807395
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0791cd3fd26f
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Oct 27, 2020

  1. Now pass the current Pango context to Pango::Layout::Create() so it u…

    …ses the right DPI. See #257. Still more work needed to scale sizes of UI elements appropriately.
    azonenberg committed Oct 27, 2020
    1
    Copy the full SHA
    0791cd3 View commit details
Showing with 9 additions and 10 deletions.
  1. +1 −1 lib
  2. +2 −2 src/glscopeclient/Timeline.cpp
  3. +0 −1 src/glscopeclient/WaveformArea.cpp
  4. +6 −6 src/glscopeclient/WaveformArea_cairo.cpp
4 changes: 2 additions & 2 deletions src/glscopeclient/Timeline.cpp
Original file line number Diff line number Diff line change
@@ -264,7 +264,7 @@ void Timeline::Render(const Cairo::RefPtr<Cairo::Context>& cr, OscilloscopeChann
double tstart = round(m_group->m_xAxisOffset / grad_ps_rounded) * grad_ps_rounded;

//Print tick marks and labels
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
Pango::FontDescription font("sans normal 10");
font.set_weight(Pango::WEIGHT_NORMAL);
tlayout->set_font_description(font);
@@ -390,7 +390,7 @@ void Timeline::DrawCursor(

Gdk::Color black("black");

Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
Pango::FontDescription font("sans normal 10");
font.set_weight(Pango::WEIGHT_NORMAL);
tlayout->set_font_description(font);
1 change: 0 additions & 1 deletion src/glscopeclient/WaveformArea.cpp
Original file line number Diff line number Diff line change
@@ -60,7 +60,6 @@ WaveformArea::WaveformArea(
m_infoBoxFont.set_weight(Pango::WEIGHT_NORMAL);
m_cursorLabelFont.set_weight(Pango::WEIGHT_NORMAL);
m_decodeFont.set_weight(Pango::WEIGHT_NORMAL);

SharedCtorInit();
}

12 changes: 6 additions & 6 deletions src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
//Calculate width of right side axis label
int twidth;
int theight;
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
tlayout->set_font_description(m_axisLabelFont);
tlayout->set_text("500.000 mV_xx");
tlayout->get_pixel_size(twidth, theight);
@@ -609,7 +609,7 @@ void WaveformArea::RenderChannelInfoBox(
//Figure out text size
int twidth;
int theight;
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
tlayout->set_font_description(m_infoBoxFont);
tlayout->set_text(text);
tlayout->get_pixel_size(twidth, theight);
@@ -667,7 +667,7 @@ void WaveformArea::RenderCursor(Cairo::RefPtr< Cairo::Context > cr, int64_t pos,
//Figure out text size
int twidth;
int theight;
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
tlayout->set_font_description(m_cursorLabelFont);
tlayout->set_text(text);
tlayout->get_pixel_size(twidth, theight);
@@ -789,7 +789,7 @@ void WaveformArea::RenderInBandPower(Cairo::RefPtr< Cairo::Context > cr)
//Calculate text size
int twidth;
int theight;
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
tlayout->set_font_description(m_cursorLabelFont);
tlayout->set_text(text);
tlayout->get_pixel_size(twidth, theight);
@@ -944,7 +944,7 @@ void WaveformArea::RenderComplexSignal(
int width;
int sheight;

Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
tlayout->set_font_description(m_decodeFont);
tlayout->set_text(str);
tlayout->get_pixel_size(width, sheight);
@@ -1082,7 +1082,7 @@ void WaveformArea::RenderFFTPeaks(Cairo::RefPtr< Cairo::Context > cr)
int64_t timescale = data->m_timescale;

//Settings for the text
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create(get_pango_context());
tlayout->set_font_description(m_cursorLabelFont);
int twidth;
int theight;