Correction du défilement à la souris (pointeur)
This commit is contained in:
parent
7d46367eb5
commit
dd54596cb7
|
@ -277,18 +277,29 @@ void Editor::frame() {
|
|||
sf::Vector2i mouse = sf::Mouse::getPosition(window);
|
||||
|
||||
// détection du dépassement sur un des 4 bords
|
||||
if (mouse.x < POINTER_SCROLL_PADDING && mouse.x >= -POINTER_SCROLL_PADDING) {
|
||||
if (mouse.x >= -POINTER_SCROLL_PADDING &&
|
||||
mouse.x < window_size.x + POINTER_SCROLL_PADDING &&
|
||||
mouse.y >= -POINTER_SCROLL_PADDING &&
|
||||
mouse.y < window_size.y + POINTER_SCROLL_PADDING) {
|
||||
if (mouse.x < POINTER_SCROLL_PADDING) {
|
||||
cur_center.x -= POINTER_SCROLL_SPEED;
|
||||
} else if (mouse.x >= window_size.x - POINTER_SCROLL_PADDING && mouse.x < window_size.x + POINTER_SCROLL_PADDING) {
|
||||
}
|
||||
|
||||
if (mouse.x >= window_size.x - POINTER_SCROLL_PADDING) {
|
||||
cur_center.x += POINTER_SCROLL_SPEED;
|
||||
} else if (mouse.y < POINTER_SCROLL_PADDING && mouse.y >= -POINTER_SCROLL_PADDING) {
|
||||
}
|
||||
|
||||
if (mouse.y < POINTER_SCROLL_PADDING) {
|
||||
cur_center.y -= POINTER_SCROLL_SPEED;
|
||||
} else if (mouse.y >= window_size.y - POINTER_SCROLL_PADDING && mouse.y < window_size.y + POINTER_SCROLL_PADDING) {
|
||||
}
|
||||
|
||||
if (mouse.y >= window_size.y - POINTER_SCROLL_PADDING) {
|
||||
cur_center.y += POINTER_SCROLL_SPEED;
|
||||
}
|
||||
|
||||
setCenterGoal(cur_center);
|
||||
}
|
||||
}
|
||||
|
||||
// màj du titre de la fenêtre
|
||||
getManager().setTitle(sf::String(L"Édition de ") + getName());
|
||||
|
|
Loading…
Reference in New Issue