mirror of https://github.com/stella-emu/stella.git
changed y-position displayed in tooltip to scanline number
This commit is contained in:
parent
ae452ffb09
commit
763685e0c3
|
@ -104,14 +104,14 @@ void TiaOutputWidget::saveSnapshot(int execDepth, const string& execPrefix)
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void TiaOutputWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
|
void TiaOutputWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
|
||||||
{
|
{
|
||||||
if(b == MouseButton::LEFT)
|
if(b == MouseButton::LEFT)
|
||||||
myZoom->setPos(x, y);
|
myZoom->setPos(x, y);
|
||||||
// Grab right mouse button for command context menu
|
// Grab right mouse button for command context menu
|
||||||
else if(b == MouseButton::RIGHT)
|
else if(b == MouseButton::RIGHT)
|
||||||
{
|
{
|
||||||
myClickX = x;
|
myClickX = x;
|
||||||
myClickY = y;
|
myClickY = y - 1;
|
||||||
|
|
||||||
dialog().tooltip().hide();
|
dialog().tooltip().hide();
|
||||||
// Add menu at current x,y mouse location
|
// Add menu at current x,y mouse location
|
||||||
|
@ -184,6 +184,7 @@ string TiaOutputWidget::getToolTip(const Common::Point& pos) const
|
||||||
if(idx.x < 0)
|
if(idx.x < 0)
|
||||||
return EmptyString;
|
return EmptyString;
|
||||||
|
|
||||||
|
const uInt32 startLine = instance().console().tia().startLine();
|
||||||
const uInt32 height = instance().console().tia().height();
|
const uInt32 height = instance().console().tia().height();
|
||||||
// limit to 274 lines (PAL default without scaling)
|
// limit to 274 lines (PAL default without scaling)
|
||||||
const uInt32 yStart = height <= FrameManager::Metrics::baseHeightPAL
|
const uInt32 yStart = height <= FrameManager::Metrics::baseHeightPAL
|
||||||
|
@ -194,7 +195,7 @@ string TiaOutputWidget::getToolTip(const Common::Point& pos) const
|
||||||
|
|
||||||
buf << _toolTipText
|
buf << _toolTipText
|
||||||
<< "X: #" << idx.x
|
<< "X: #" << idx.x
|
||||||
<< "\nY: #" << idx.y
|
<< "\nY: #" << idx.y + startLine
|
||||||
<< "\nC: $" << Common::Base::toString(tiaOutputBuffer[i], Common::Base::Fmt::_16);
|
<< "\nC: $" << Common::Base::toString(tiaOutputBuffer[i], Common::Base::Fmt::_16);
|
||||||
|
|
||||||
return buf.str();
|
return buf.str();
|
||||||
|
|
|
@ -117,7 +117,7 @@ void TiaZoomWidget::recalc()
|
||||||
void TiaZoomWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
|
void TiaZoomWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
|
||||||
{
|
{
|
||||||
myClickX = x;
|
myClickX = x;
|
||||||
myClickY = y;
|
myClickY = y - 1;
|
||||||
|
|
||||||
// Button 1 is for 'drag'/movement of the image
|
// Button 1 is for 'drag'/movement of the image
|
||||||
// Button 2 is for context menu
|
// Button 2 is for context menu
|
||||||
|
@ -148,7 +148,7 @@ void TiaZoomWidget::handleMouseWheel(int x, int y, int direction)
|
||||||
|
|
||||||
// zoom towards mouse position
|
// zoom towards mouse position
|
||||||
myClickX = x;
|
myClickX = x;
|
||||||
myClickY = y;
|
myClickY = y - 1;
|
||||||
|
|
||||||
if(direction > 0)
|
if(direction > 0)
|
||||||
{
|
{
|
||||||
|
@ -167,6 +167,7 @@ void TiaZoomWidget::handleMouseMoved(int x, int y)
|
||||||
{
|
{
|
||||||
if(myMouseMoving)
|
if(myMouseMoving)
|
||||||
{
|
{
|
||||||
|
y--;
|
||||||
int diffx = x + myOffXLo - myClickX;
|
int diffx = x + myOffXLo - myClickX;
|
||||||
int diffy = y + myOffYLo - myClickY;
|
int diffy = y + myOffYLo - myClickY;
|
||||||
|
|
||||||
|
@ -302,12 +303,13 @@ string TiaZoomWidget::getToolTip(const Common::Point& pos) const
|
||||||
return EmptyString;
|
return EmptyString;
|
||||||
|
|
||||||
const Int32 i = idx.x + idx.y * instance().console().tia().width();
|
const Int32 i = idx.x + idx.y * instance().console().tia().width();
|
||||||
|
const uInt32 startLine = instance().console().tia().startLine();
|
||||||
uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer();
|
uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer();
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
||||||
buf << _toolTipText
|
buf << _toolTipText
|
||||||
<< "X: #" << idx.x
|
<< "X: #" << idx.x
|
||||||
<< "\nY: #" << idx.y
|
<< "\nY: #" << idx.y + startLine
|
||||||
<< "\nC: $" << Common::Base::toString(tiaOutputBuffer[i], Common::Base::Fmt::_16);
|
<< "\nC: $" << Common::Base::toString(tiaOutputBuffer[i], Common::Base::Fmt::_16);
|
||||||
|
|
||||||
return buf.str();
|
return buf.str();
|
||||||
|
|
Loading…
Reference in New Issue