Skip to content

Commit

Permalink
Merge 2c521f4 into 6b6c77c
Browse files Browse the repository at this point in the history
  • Loading branch information
vadi2 committed Aug 7, 2019
2 parents 6b6c77c + 2c521f4 commit 8a3bf4e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/T2DMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,15 @@ QColor T2DMap::getColor(int id)
break;
default: //user defined room color
if (!mpMap->customEnvColors.contains(env)) {
if (16 < env && env < 232)
{
if (16 < env && env < 232) {
quint8 base = env - 16;
quint8 r = base / 36;
quint8 g = (base - (r * 36)) / 6;
quint8 b = (base - (r * 36)) - (g * 6);

r = r * 51;
g = g * 51;
b = b * 51;
r = r * 51;
g = g * 51;
b = b * 51;
color = QColor(r, g, b, 255);
} else if (231 < env && env < 256) {
quint8 k = ((env - 232) * 10) + 8;
Expand Down Expand Up @@ -2739,8 +2738,7 @@ void T2DMap::mousePressEvent(QMouseEvent* event)
while (itRoom.hasNext()) {
auto _item = new QTreeWidgetItem;
int multiSelectionRoomId = itRoom.next();
// Using QStringLiteral so we can pad text form with spaces so sorting works:
_item->setText(0, key_plain.arg(multiSelectionRoomId, 7));
_item->setText(0, key_plain.arg(multiSelectionRoomId, mMaxRoomIdDigits));
_item->setTextAlignment(0, Qt::AlignRight);
TRoom* pR_multiSelection = mpMap->mpRoomDB->getRoom(multiSelectionRoomId);
if (pR_multiSelection) {
Expand Down Expand Up @@ -4424,7 +4422,7 @@ void T2DMap::mouseMoveEvent(QMouseEvent* event)
while (itRoom.hasNext()) {
auto item = new QTreeWidgetItem;
int multiSelectionRoomId = itRoom.next();
item->setText(0, QStringLiteral("%1").arg(multiSelectionRoomId, 7));
item->setText(0, QStringLiteral("%1").arg(multiSelectionRoomId, mMaxRoomIdDigits));
item->setTextAlignment(0, Qt::AlignRight);
TRoom* pR_multiSelection = mpMap->mpRoomDB->getRoom(multiSelectionRoomId);
if (pR_multiSelection) {
Expand Down

0 comments on commit 8a3bf4e

Please sign in to comment.