Commit graph

11 commits

Author SHA1 Message Date
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Jelle Raaijmakers
54108263d6 LibGfx: Add IntVector2/3/4 types
The type `Vector<N, int>` is used often enough that it warrants its own
dedicated type.
2022-05-05 20:50:46 +02:00
Lenny Maiorani
d144da3a62 LibGfx: Refactor Vector[2,3,4] to VectorN with specializations
`Gfx::Vector[2,3,4]` are nearly identical implementations. This code
redundancy does not follow the DRY (Don't Repeat Yourself) principle
leading to possible out-of-sync errors between the classes.

Combining these classes into a class template which can be specialized
for each needed size makes the differences obvious through
`constexpr-if` blocks and `requires` clauses.
2022-03-04 12:56:05 +01:00
Jesse Buhagiar
53ed93d909 LibGfx: Add unary operator-() to Vector2/3/4 2022-01-18 01:48:51 +02:00
Stephan Unverwerth
b07bb85700 LibGfx: Allow Vector{2,3,4} operators to accept different argument types
This is needed to e.g. multiply a Vector4<f32x4> by a float.
2022-01-09 16:21:13 +03:30
Andreas Kling
216e21a1fa AK: Convert AK::Format formatting helpers to returning ErrorOr<void>
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
2021-11-17 00:21:13 +01:00
Hendiadyoin1
ed46d52252 Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
2021-07-19 16:34:21 +04:30
Daniel Bertalan
e364845456 LibGfx: Don't constexpr functions returning Strings
Since strings don't have a constexpr constructor, these won't have any
effect anyways. Furthermore, this is explicitly disallowed by the
standard, and makes Clang tools freak out.
2021-06-24 17:35:49 +04:30
Stephan Unverwerth
10ceeb092f Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00
Jelle Raaijmakers
5864aab87a LibGfx/Vector*: Implement Formatters 2021-05-15 00:41:30 +01:00
Stephan Unverwerth
aff6426000 LibGfx: Add Vector2 class 2021-05-13 08:34:26 +02:00