Class: Diffux::SnapshotComparisonImage::Before

Inherits:
Base
  • Object
show all
Defined in:
lib/diffux_core/snapshot_comparison_image/before.rb

Overview

This subclass of ‘SnapshotComparisonImage` knows how to draw the representation of the “before” image.

Constant Summary

Constants inherited from Base

Diffux::SnapshotComparisonImage::Base::BASE_ALPHA, Diffux::SnapshotComparisonImage::Base::BASE_DIFF_ALPHA, Diffux::SnapshotComparisonImage::Base::BASE_OPACITY, Diffux::SnapshotComparisonImage::Base::GREEN, Diffux::SnapshotComparisonImage::Base::MAGENTA, Diffux::SnapshotComparisonImage::Base::RED

Instance Method Summary collapse

Methods inherited from Base

#diff_alpha, #initialize, #pixel_diff_score, #render_added_row, #render_pixel, #render_row, #render_unchanged_row

Constructor Details

This class inherits a constructor from Diffux::SnapshotComparisonImage::Base

Instance Method Details

#render_changed_row(y, row) ⇒ Object

Parameters:

  • y (Integer)
  • row (Diff::LCS:ContextChange)


8
9
10
# File 'lib/diffux_core/snapshot_comparison_image/before.rb', line 8

def render_changed_row(y, row)
  render_deleted_row(y, row)
end

#render_deleted_row(y, row) ⇒ Object

Parameters:

  • y (Integer)
  • row (Diff::LCS:ContextChange)


14
15
16
17
18
# File 'lib/diffux_core/snapshot_comparison_image/before.rb', line 14

def render_deleted_row(y, row)
  row.old_element.each_with_index do |pixel_before, x|
    render_pixel(x, y, pixel_before)
  end
end