mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 10:18:59 +00:00
LibGfx/JBIG2: Simplify non-transposed text region coordinate math
If the origin is on the right, we need to subtract width - 1 from s, if it's on top bottom, we need to subtract height - 1 from t. No behavior change.
This commit is contained in:
parent
851114e462
commit
ca6ebedf58
Notes:
sideshowbarker
2024-07-17 08:35:21 +09:00
Author: https://github.com/nico
Commit: ca6ebedf58
Pull-request: https://github.com/SerenityOS/serenity/pull/23780
Reviewed-by: https://github.com/LucasChollet ✅
1 changed files with 2 additions and 12 deletions
|
@ -1442,20 +1442,10 @@ static ErrorOr<NonnullOwnPtr<BitBuffer>> text_region_decoding_procedure(TextRegi
|
|||
// Implementor's note: The spec means "ignore this part of IBI in step 3 c) x)" in 3c viii)'s last sentence.
|
||||
// FIXME: Support all reference corners and transpose values.
|
||||
if (!inputs.is_transposed) {
|
||||
switch (inputs.reference_corner) {
|
||||
case TopLeft:
|
||||
break;
|
||||
case TopRight:
|
||||
if (inputs.reference_corner == TopRight || inputs.reference_corner == BottomRight)
|
||||
s_instance -= symbol.width() - 1;
|
||||
break;
|
||||
case BottomLeft:
|
||||
if (inputs.reference_corner == BottomLeft || inputs.reference_corner == BottomRight)
|
||||
t_instance -= symbol.height() - 1;
|
||||
break;
|
||||
case BottomRight:
|
||||
s_instance -= symbol.width() - 1;
|
||||
t_instance -= symbol.height() - 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
TODO();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue