Fix sensors
Signed-off-by: Vasiliy Doylov <nekodevelopper@gmail.com>
This commit is contained in:
parent
a563c5dc4f
commit
c91388f6de
1 changed files with 0 additions and 7 deletions
|
@ -19,19 +19,12 @@ class TheCatTools.GUI.Bubble : DrawingAreaOrientable {
|
|||
}
|
||||
|
||||
public override void draw_func (Gtk.DrawingArea self, Cairo.Context cr, int width, int height) {
|
||||
message ("Draw %d %d", width, height);
|
||||
var radius = int.min (width, height) / 2;
|
||||
var val_x = clamped (value_x);
|
||||
var val_y = clamped (value_y);
|
||||
var range = adjustment.upper - adjustment.lower;
|
||||
var position_y = radius + (height - 2 * radius) * (val_y - adjustment.lower) / range;
|
||||
var position_x = radius + (width - 2 * radius) * (val_x - adjustment.lower) / range;
|
||||
message ("%f %f -> %f %f -> %f %f\t%f",
|
||||
value_x, value_y,
|
||||
val_x, val_y,
|
||||
position_x, position_y,
|
||||
range
|
||||
);
|
||||
Utils.set_color_rgba (cr, get_color ());
|
||||
cr.arc (position_x, position_y, radius, 0, Math.PI * 2);
|
||||
cr.fill ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue