Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions composite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "composite.h"
#include <gdkmm.h>
#include <glibmm/i18n.h>
#include <gdk/gdk.h>


double red, green, blue, alpha, width;
std::list<Trace::Point> points;
Expand Down Expand Up @@ -49,6 +51,9 @@ Composite::Composite() {
#define N 128
int w = gdk_screen_width();
int h = gdk_screen_height();
GdkDisplay* dp = gdk_display_get_default();
GdkMonitor* mon = gdk_display_get_primary_monitor(dp);
scale_factor = gdk_monitor_get_scale_factor(mon);
num_x = (gdk_screen_width() - 1)/N + 1;
num_y = (gdk_screen_height() - 1)/N + 1;
pieces = new Popup**[num_x];
Expand All @@ -61,6 +66,12 @@ Composite::Composite() {
}

void Composite::draw(Point p, Point q) {
if(scale_factor > 0) {
p.x /= scale_factor;
p.y /= scale_factor;
q.x /= scale_factor;
q.y /= scale_factor;
}
if (!points.size()) {
points.push_back(p);
}
Expand Down
1 change: 1 addition & 0 deletions composite.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Popup : public Gtk::Window {

class Composite : public Trace {
int num_x, num_y;
int scale_factor;
Popup ***pieces;
virtual void draw(Point p, Point q);
virtual void start_();
Expand Down