Compare commits

..

No commits in common. "4109dfe8c3ca47efdd03130f6f4529b880da9b85" and "a3843e8417359d086986f46245276ea23971506c" have entirely different histories.

5 changed files with 9 additions and 26 deletions

View file

@ -44,7 +44,7 @@ trait TAttachmentHost
continue;
}
$skipped[] = $child;
$skipped[] = ["100%", "unset", $child, "unset"];
}
$height = "unset";
@ -66,8 +66,7 @@ trait TAttachmentHost
return (object) [
"width" => $width . "px",
"height" => $height . "px",
"tiles" => $result,
"extras" => $skipped,
"tiles" => array_merge($result, $skipped),
];
}

View file

@ -68,17 +68,11 @@
{var $width = $width - 70 * $GLOBALS["_nesAttGloCou"]}
{/if}
{var $attachmentsLayout = $post->getChildrenWithLayout($width)}
<div n:ifcontent class="attachments attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
<div n:ifcontent class="attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
<div class="attachment" n:foreach="$attachmentsLayout->tiles as $attachment" style="float: {$attachment[3]|noescape}; width: {$attachment[0]|noescape}; height: {$attachment[1]|noescape};" data-localized-nsfw-text="{_nsfw_warning}">
{include "../attachment.xml", attachment => $attachment[2], post => $post}
</div>
</div>
<div n:ifcontent class="attachments attachments_m">
<div class="attachment" n:foreach="$attachmentsLayout->extras as $attachment">
{include "../attachment.xml", attachment => $attachment, post => $post}
</div>
</div>
</div>
<div n:if="$post->isAd()" style="color:grey;">
<br/>

View file

@ -62,17 +62,11 @@
{var $width = $width - 70 * $GLOBALS["_nesAttGloCou"]}
{/if}
{var $attachmentsLayout = $post->getChildrenWithLayout($width)}
<div n:ifcontent class="attachments attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
<div n:ifcontent class="attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
<div class="attachment" n:foreach="$attachmentsLayout->tiles as $attachment" style="float: {$attachment[3]|noescape}; width: {$attachment[0]|noescape}; height: {$attachment[1]|noescape};" data-localized-nsfw-text="{_nsfw_warning}">
{include "../attachment.xml", attachment => $attachment[2], post => $post}
</div>
</div>
<div n:ifcontent class="attachments attachments_m">
<div class="attachment" n:foreach="$attachmentsLayout->extras as $attachment">
{include "../attachment.xml", attachment => $attachment}
</div>
</div>
</div>
<div n:if="$post->isAd()" style="color:grey;">
<br/>

View file

@ -89,12 +89,12 @@ class Makima
($maxWidth - $marginWidth) / $ratios[1] / ( (1 / $ratios[0]) + (1 / $ratios[1]) )
);
$w1 = $maxWidth - $w0 - $marginWidth;
$h = min($maxHeight, min($w0 / $ratios[0], $w1 / $ratios[1]));
$h = min($maxHeight, min($w0 / $ratios[0], $w / $ratios[1]));
$result->colSizes = [ceil($w0), ceil($w1)];
$result->rowSizes = [1];
$result->width = ceil($w0 + $w1 + $marginWidth);
$result->height = ceil($h);
$result->height = ceil($height);
$result->tiles = [new ThumbTile(1, 1, $w0, $h), new ThumbTile(1, 1, $w1, $h)];
}
break;
@ -103,7 +103,7 @@ class Makima
if($orients == [Makima::ORIENT_WIDE, Makima::ORIENT_WIDE, Makima::ORIENT_WIDE]) {
$hCover = min($maxWidth / $ratios[0], ($maxHeight - $marginHeight) * (2 / 3));
$w2 = ($maxWidth - $marginWidth) / 2;
$h = min($maxHeight - $hCover - $marginHeight, min($w2 / $ratios[1], $w2 / $ratios[2]));
$h = min($maxHeight - $hCover - $margin, min($w2 / $ratios[1], $w2 / $ratios[2]));
$result->colSizes = [1, 1];
$result->rowSizes = [ceil($hCover), ceil($h)];
@ -269,7 +269,7 @@ class Makima
$result->tiles[$k++] = $row[] = $tile;
}
$rowTiles[] = $row;
$result->rowTiles[] = $row;
}
sort($gridLineOffsets, SORT_NUMERIC);

View file

@ -729,14 +729,10 @@ h4 {
line-height: 130%;
}
.post-content .attachments:first-of-type {
.post-content .attachments_b {
margin-top: 8px;
}
.post-content .attachments_m .attachment {
width: 98%;
}
.attachment .post {
width: 102%;
}