mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
Remove nitpicker_gfx/miscmath.h
This commit is contained in:
parent
99ddd1cd85
commit
e809192b97
@ -90,9 +90,9 @@ class Log_entry
|
||||
*/
|
||||
void draw(Canvas *canvas, int y, int new_section = false)
|
||||
{
|
||||
Color label_fgcol = Color(min(255, _color.r + 200),
|
||||
min(255, _color.g + 200),
|
||||
min(255, _color.b + 200));
|
||||
Color label_fgcol = Color(Genode::min(255, _color.r + 200),
|
||||
Genode::min(255, _color.g + 200),
|
||||
Genode::min(255, _color.b + 200));
|
||||
Color label_bgcol = Color(_color.r, _color.g, _color.b);
|
||||
Color text_fgcol = Color(180, 180, 180);
|
||||
Color text_bgcol = Color(_color.r / 2, _color.g / 2, _color.b / 2);
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include <util/geometry.h>
|
||||
|
||||
#include <nitpicker_gfx/miscmath.h>
|
||||
#include <nitpicker_gfx/color.h>
|
||||
#include <nitpicker_gfx/font.h>
|
||||
|
||||
|
@ -109,8 +109,8 @@ class Chunky_canvas : public Canvas
|
||||
for ( ; *str && (x <= _clip.x2()); str++) {
|
||||
|
||||
int w = font.wtab[*str];
|
||||
int start = max(0, _clip.x1() - x);
|
||||
int end = min(w - 1, _clip.x2() - x);
|
||||
int start = Genode::max(0, _clip.x1() - x);
|
||||
int end = Genode::min(w - 1, _clip.x2() - x);
|
||||
PT *d = dst + x;
|
||||
unsigned char const *s = src + font.otab[*str];
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* \brief Commonly used math functions
|
||||
* \author Norman Feske
|
||||
* \date 2006-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__NITPICKER_GFX__MISCMATH_H_
|
||||
#define _INCLUDE__NITPICKER_GFX__MISCMATH_H_
|
||||
|
||||
template <typename T>
|
||||
T max(T v1, T v2) { return v1 > v2 ? v1 : v2; }
|
||||
|
||||
template <typename T>
|
||||
T min(T v1, T v2) { return v1 < v2 ? v1 : v2; }
|
||||
|
||||
#endif /* _INCLUDE__NITPICKER_GFX__MISCMATH_H_ */
|
@ -57,8 +57,8 @@ void User_state::handle_event(Input::Event ev)
|
||||
/* transparently handle absolute and relative motion events */
|
||||
if (type == Event::MOTION) {
|
||||
if ((ev.rx() || ev.ry()) && ev.ax() == 0 && ev.ay() == 0) {
|
||||
ax = max(0, min((int)size().w(), ax + ev.rx()));
|
||||
ay = max(0, min((int)size().h(), ay + ev.ry()));
|
||||
ax = Genode::max(0, Genode::min((int)size().w(), ax + ev.rx()));
|
||||
ay = Genode::max(0, Genode::min((int)size().h(), ay + ev.ry()));
|
||||
} else {
|
||||
ax = ev.ax();
|
||||
ay = ev.ay();
|
||||
|
@ -92,8 +92,8 @@ unsigned Vancouver_console::_input_to_ps2mouse(Input::Event const *ev)
|
||||
|
||||
/* clamp relative motion vector to bounds */
|
||||
int const boundary = 200;
|
||||
int const rx = min(boundary, max(-boundary, ev->rx()));
|
||||
int const ry = -min(boundary, max(-boundary, ev->ry()));
|
||||
int const rx = Genode::min(boundary, Genode::max(-boundary, ev->rx()));
|
||||
int const ry = -Genode::min(boundary, Genode::max(-boundary, ev->ry()));
|
||||
|
||||
/* assemble PS/2 packet */
|
||||
Ps2_mouse_packet::access_t packet = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user