changed y-position displayed in tooltip to scanline number

This commit is contained in:
thrust26 2020-11-19 23:18:28 +01:00
parent ae452ffb09
commit 763685e0c3
2 changed files with 9 additions and 6 deletions

View File

@ -104,14 +104,14 @@ void TiaOutputWidget::saveSnapshot(int execDepth, const string& execPrefix)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TiaOutputWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
{
{
if(b == MouseButton::LEFT)
myZoom->setPos(x, y);
// Grab right mouse button for command context menu
else if(b == MouseButton::RIGHT)
{
myClickX = x;
myClickY = y;
myClickY = y - 1;
dialog().tooltip().hide();
// Add menu at current x,y mouse location
@ -184,6 +184,7 @@ string TiaOutputWidget::getToolTip(const Common::Point& pos) const
if(idx.x < 0)
return EmptyString;
const uInt32 startLine = instance().console().tia().startLine();
const uInt32 height = instance().console().tia().height();
// limit to 274 lines (PAL default without scaling)
const uInt32 yStart = height <= FrameManager::Metrics::baseHeightPAL
@ -194,7 +195,7 @@ string TiaOutputWidget::getToolTip(const Common::Point& pos) const
buf << _toolTipText
<< "X: #" << idx.x
<< "\nY: #" << idx.y
<< "\nY: #" << idx.y + startLine
<< "\nC: $" << Common::Base::toString(tiaOutputBuffer[i], Common::Base::Fmt::_16);
return buf.str();

View File

@ -117,7 +117,7 @@ void TiaZoomWidget::recalc()
void TiaZoomWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
{
myClickX = x;
myClickY = y;
myClickY = y - 1;
// Button 1 is for 'drag'/movement of the image
// Button 2 is for context menu
@ -148,7 +148,7 @@ void TiaZoomWidget::handleMouseWheel(int x, int y, int direction)
// zoom towards mouse position
myClickX = x;
myClickY = y;
myClickY = y - 1;
if(direction > 0)
{
@ -167,6 +167,7 @@ void TiaZoomWidget::handleMouseMoved(int x, int y)
{
if(myMouseMoving)
{
y--;
int diffx = x + myOffXLo - myClickX;
int diffy = y + myOffYLo - myClickY;
@ -302,12 +303,13 @@ string TiaZoomWidget::getToolTip(const Common::Point& pos) const
return EmptyString;
const Int32 i = idx.x + idx.y * instance().console().tia().width();
const uInt32 startLine = instance().console().tia().startLine();
uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer();
ostringstream buf;
buf << _toolTipText
<< "X: #" << idx.x
<< "\nY: #" << idx.y
<< "\nY: #" << idx.y + startLine
<< "\nC: $" << Common::Base::toString(tiaOutputBuffer[i], Common::Base::Fmt::_16);
return buf.str();