#include <QPainter> #include "MergeEditor.h" MergeEditor::MergeEditor(void) { } MergeEditor::~MergeEditor(void) { } void MergeEditor::setTheirs( QImage* t ) { theirs = t; scratch = QImage( theirs->size(), QImage::Format_ARGB32_Premultiplied ); s_alpha = QImage( theirs->size(), QImage::Format_Indexed8 ); QVector<QRgb> colors(256); for ( int i = 0 ; i < 256 ; i++ ) { colors[i] = qRgb( i, i, i ); } s_alpha.setColorTable( colors ); texture = QPixmap( theirs->size() ); QPainter p( &scratch ); p.drawImage( 0, 0, *theirs ); } void MergeEditor::setBlend( int alpha ) { if ( !theirs ) return; s_alpha.fill( alpha ); scratch.setAlphaChannel( s_alpha ); QPainter p( &texture ); p.drawImage( 0, 0, *yours ); p.drawImage( 0, 0, scratch ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 5549 | Sam Stafford |
Fix another edge case bug where Qt's behavior is the opposite of what I'd expect - when an empty clip region is set, the clip region is cleared entirely, as if a FULL clip region had been set. The resulting bug was that any image which had zero conflicts would show up as one gigantic conflict - ack! The code now checks for this case and bails out of any painting operation that's about to use an empty clip region. |
||
#6 | 5539 | Sam Stafford | Kick off another window to merge alpha channels, if present. | ||
#5 | 5534 | Sam Stafford |
A brand new help file, a bit of cosmetic sprucing, one critical bug fix, and a partridge in a pear tree. |
||
#4 | 5524 | Sam Stafford | Eraser and spraypaint tools, and "Save" command. | ||
#3 | 5520 | Sam Stafford |
Configurable brush sizes, complete with procedurally generated icons. Spiffy. |
||
#2 | 5519 | Sam Stafford |
Added the paintbrush tool. Now we're getting somewhere. |
||
#1 | 5516 | Sam Stafford | The M is for Merge. |