mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Fix graph not updated when changing function and theme switch
This commit is contained in:
parent
aa20044766
commit
78737c3f7b
@ -199,29 +199,29 @@ BBGraph.prototype.render = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (r2ui.graph_panel.minimap) {
|
// if (r2ui.graph_panel.minimap) {
|
||||||
update_minimap();
|
// update_minimap();
|
||||||
$("#minimap_area").draggable({
|
// $("#minimap_area").draggable({
|
||||||
containment: "parent",
|
// containment: "parent",
|
||||||
stop: function( event, ui ) {
|
// stop: function( event, ui ) {
|
||||||
var delta_x = ui.position.left/scale;
|
// var delta_x = ui.position.left/scale;
|
||||||
var delta_y = ui.position.top/scale;
|
// var delta_y = ui.position.top/scale;
|
||||||
if (delta_x < 0) delta_x = 0;
|
// if (delta_x < 0) delta_x = 0;
|
||||||
if (delta_y < 0) delta_y = 0;
|
// if (delta_y < 0) delta_y = 0;
|
||||||
if ($("#radareApp_mp").length) {
|
// if ($("#radareApp_mp").length) {
|
||||||
//$("#main_panel").scrollTo({ top:delta_y, left:delta_x - delta/scale } );
|
// //$("#main_panel").scrollTo({ top:delta_y, left:delta_x - delta/scale } );
|
||||||
console.log(1);
|
// console.log(1);
|
||||||
} else {
|
// } else {
|
||||||
//$('#center_panel').scrollTo({ top:delta_y, left:delta_x - delta/scale } );
|
// //$('#center_panel').scrollTo({ top:delta_y, left:delta_x - delta/scale } );
|
||||||
console.log('debug:');
|
// console.log('debug:');
|
||||||
console.log(delta_y, delta_x, scale);
|
// console.log(delta_y, delta_x, scale);
|
||||||
console.log($('#center_panel'));
|
// console.log($('#center_panel'));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
$("#minimap").hide();
|
// $("#minimap").hide();
|
||||||
}
|
// }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ function html_for_instruction(ins) {
|
|||||||
if (info !== null && info !== undefined && info.length > 0)
|
if (info !== null && info !== undefined && info.length > 0)
|
||||||
idump += '<div class="ec_fname">(fcn) ' + info[0].name + '</div>';
|
idump += '<div class="ec_fname">(fcn) ' + info[0].name + '</div>';
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Error getting instruction information from afij command");
|
console.log("Error getting instruction information from afij command: " + err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get function variables
|
// Get function variables
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QWebEngineSettings>
|
#include <QWebEngineSettings>
|
||||||
|
#include <QWebEngineProfile>
|
||||||
|
|
||||||
MemoryWidget::MemoryWidget(MainWindow *main) :
|
MemoryWidget::MemoryWidget(MainWindow *main) :
|
||||||
QDockWidget(main),
|
QDockWidget(main),
|
||||||
@ -1509,18 +1510,22 @@ void MemoryWidget::fillOffsetInfo(QString off)
|
|||||||
|
|
||||||
void MemoryWidget::create_graph(QString off)
|
void MemoryWidget::create_graph(QString off)
|
||||||
{
|
{
|
||||||
|
// No Cache enabled in 5.7
|
||||||
|
// ui->graphWebView->page()->profile()->setHttpCacheType(QWebEngineProfile::NoCache);
|
||||||
|
// force reload by first loading a blank page
|
||||||
|
// this is a workaround since it shows a white glitch
|
||||||
|
ui->graphWebView->setUrl(QUrl("about:blank"));
|
||||||
|
|
||||||
ui->graphWebView->setZoomFactor(0.85);
|
ui->graphWebView->setZoomFactor(0.85);
|
||||||
//this->main->add_debug_output("Graph Offset: '" + off + "'");
|
this->main->add_debug_output("Graph Offset: '" + off + "'");
|
||||||
if (off == "")
|
if (off == "")
|
||||||
{
|
{
|
||||||
off = "0x0" + this->main->core->cmd("s").split("0x")[1].trimmed();
|
off = "0x0" + this->main->core->cmd("s").split("0x")[1].trimmed();
|
||||||
}
|
}
|
||||||
QString fcn = this->main->core->cmdFunctionAt(off);
|
//QString fcn = this->main->core->cmdFunctionAt(off);
|
||||||
|
|
||||||
//this->main->add_debug_output("Graph Fcn: " + fcn);
|
//this->main->add_debug_output("Graph Fcn: " + fcn);
|
||||||
ui->graphWebView->setUrl(QUrl("qrc:/graph/html/graph/index.html#" + off));
|
ui->graphWebView->setUrl(QUrl("qrc:/graph/html/graph/index.html#" + off));
|
||||||
QString port = this->main->core->config("http.port");
|
QString port = this->main->core->config("http.port");
|
||||||
|
|
||||||
ui->graphWebView->page()->runJavaScript(QString("r2.root=\"http://localhost:%1\"").arg(port));
|
ui->graphWebView->page()->runJavaScript(QString("r2.root=\"http://localhost:%1\"").arg(port));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1875,11 +1880,14 @@ void MemoryWidget::switchTheme(bool dark)
|
|||||||
if (dark)
|
if (dark)
|
||||||
{
|
{
|
||||||
ui->webSimpleGraph->page()->setBackgroundColor(QColor(64, 64, 64));
|
ui->webSimpleGraph->page()->setBackgroundColor(QColor(64, 64, 64));
|
||||||
|
ui->graphWebView->page()->runJavaScript("r2ui.graph_panel.render('dark');");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->webSimpleGraph->page()->setBackgroundColor(QColor(255, 255, 255));
|
ui->webSimpleGraph->page()->setBackgroundColor(QColor(255, 255, 255));
|
||||||
|
ui->graphWebView->page()->runJavaScript("r2ui.graph_panel.render('light');");
|
||||||
}
|
}
|
||||||
|
//ui->graphWebView->reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryWidget::on_opcodeDescButton_clicked()
|
void MemoryWidget::on_opcodeDescButton_clicked()
|
||||||
|
Loading…
Reference in New Issue
Block a user