Page MenuHomestyx hydra

DifferentialCodeWidthSensitiveView.php
No OneTemporary

DifferentialCodeWidthSensitiveView.php

<?php
abstract class DifferentialCodeWidthSensitiveView extends AphrontView {
private $lineWidth = 80;
private function setLineWidth($width) {
$this->lineWidth = $width;
return $this;
}
public function getLineWidth() {
return $this->lineWidth;
}
public function setLineWidthFromChangesets(array $changesets) {
assert_instances_of($changesets, 'DifferentialChangeset');
if (empty($changesets)) {
return $this;
}
$max = 1;
foreach ($changesets as $changeset) {
$max = max($max, $changeset->getWordWrapWidth());
}
$this->setLineWidth($max);
return $this;
}
public function calculateSideBySideWidth() {
// Width of the constant-width elements (like line numbers, padding,
// and borders).
$const = 148;
$width = ceil(((1162 - $const) / 80) * $this->getLineWidth()) + $const;
return max(1162, $width);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Nov 15, 3:55 PM (10 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
338124
Default Alt Text
DifferentialCodeWidthSensitiveView.php (905 B)

Event Timeline