mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 07:56:47 +01:00
Simplify
This commit is contained in:
parent
30f5779828
commit
1bf887edc5
1 changed files with 8 additions and 9 deletions
|
@ -421,16 +421,15 @@ zathura_document_set_rotation(zathura_document_t* document, unsigned int rotatio
|
|||
return;
|
||||
}
|
||||
|
||||
document->rotate = rotation % 360;
|
||||
|
||||
if (document->rotate > 0 && document->rotate <= 90) {
|
||||
document->rotate = 90;
|
||||
} else if (document->rotate > 0 && document->rotate <= 180) {
|
||||
document->rotate = 180;
|
||||
} else if (document->rotate > 0 && document->rotate <= 270) {
|
||||
document->rotate = 270;
|
||||
} else {
|
||||
rotation = rotation % 360;
|
||||
if (rotation == 0 || rotation > 270) {
|
||||
document->rotate = 0;
|
||||
} else if (rotation <= 90) {
|
||||
document->rotate = 90;
|
||||
} else if (rotation <= 180) {
|
||||
document->rotate = 180;
|
||||
} else {
|
||||
document->rotate = 270;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue