mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 17:01:17 +01:00
[hvgl] Simplify Align<>
This commit is contained in:
1 parent
a6ba9603c9
commit
e9c531dcbf
2 files changed
+6
-4
No files matched your search
@@ -104,9 +104,8 @@ struct PartShape
|
||||
if (unlikely (!blendTypes.sanitize (c, segmentCount))) return_trace (false);
|
||||
|
||||
const auto &padding = StructAfter<decltype (paddingX)> (blendTypes, segmentCount);
|
||||
unsigned offset = (const char *) &padding - (const char *) this;
|
||||
|
||||
const auto &coordinates = StructAfter<decltype (coordinatesX)> (padding, offset);
|
||||
const auto &coordinates = StructAfter<decltype (coordinatesX)> (padding, this);
|
||||
if (unlikely (!coordinates.sanitize (c, segmentCount))) return_trace (false);
|
||||
|
||||
const auto &deltas = StructAfter<decltype (deltasX)> (coordinates, axisCount, segmentCount);
|
||||
|
||||
+5
-2
@@ -2057,8 +2057,11 @@ struct TupleList : CFF2Index
|
||||
template <unsigned int alignment>
|
||||
struct Align
|
||||
{
|
||||
unsigned get_size (unsigned offset) const
|
||||
{ return (offset + alignment - 1) & ~(alignment - 1); }
|
||||
unsigned get_size (const void *base) const
|
||||
{
|
||||
unsigned offset = (const char *) this - (const char *) base;
|
||||
return (offset + alignment - 1) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
public:
|
||||
DEFINE_SIZE_MIN (0);
|
||||
|
||||
Reference in new issue
Block a user